This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.support.v7.app.AppCompatActivity | |
| import android.os.Bundle | |
| import android.widget.RadioButton | |
| import kotlinx.android.synthetic.main.activity_main.* | |
| import java.util.* | |
| /* | |
| random UK lottery number generator. | |
| generates a specified quantity of random numbers | |
| in the range of 1 to 59 (inclusive). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <intent-filter> | |
| <action android:name="android.intent.action.SEND" /> | |
| <category android:name="android.intent.category.DEFAULT" /> | |
| <data android:mimeType="image/*" /> | |
| </intent-filter> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Intent intent = getIntent(); | |
| String action = intent.getAction(); | |
| String type = intent.getType(); | |
| if (Intent.ACTION_SEND.equals(action)) { | |
| if (type != null) { | |
| Uri imageUri = intent.getParcelableExtra(Intent.EXTRA_STREAM); | |
| if (imageUri != null) { | |
| imageView.setImageURI(imageUri); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.wafihasan.latency; | |
| import android.annotation.SuppressLint; | |
| import android.graphics.Color; | |
| import android.os.Handler; | |
| import android.support.v7.app.AlertDialog; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.os.Bundle; | |
| import android.view.LayoutInflater; | |
| import android.view.View; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.content.DialogInterface; | |
| import android.os.Bundle; | |
| import android.os.Environment; | |
| import android.support.v7.app.AlertDialog; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.support.v7.widget.Toolbar; | |
| import android.view.LayoutInflater; | |
| import android.view.View; | |
| import android.widget.AdapterView; | |
| import android.widget.EditText; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.os.Bundle; | |
| import android.os.Environment; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.support.v7.widget.Toolbar; | |
| import android.view.View; | |
| import android.widget.AdapterView; | |
| import android.widget.ListView; | |
| import android.widget.TextView; | |
| import android.widget.Toast; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public Bitmap getWholeListViewItemsToBitmap() { | |
| ListAdapter adapter = listView.getAdapter(); | |
| int itemsCount = adapter.getCount(); | |
| int allItemsHeight = 0; | |
| List<Bitmap> bitmaps = new ArrayList<Bitmap>(); | |
| for (int i = 0; i < itemsCount; i++) { | |
| View childView = adapter.getView(i, null, listView); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private void savePalette(Bitmap bitmap) { | |
| String root = Environment.getExternalStorageDirectory().toString(); | |
| File myDir = new File(root + "/palette.io"); | |
| if(!myDir.exists()){ | |
| myDir.mkdirs(); | |
| } | |
| String fileName = "palette-io-generated-" + System.currentTimeMillis() + ".jpg"; | |
| File file = new File(myDir, fileName); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package spencerstudios.com.colourwiz; | |
| import android.content.DialogInterface; | |
| import android.content.Intent; | |
| import android.graphics.Bitmap; | |
| import android.graphics.Canvas; | |
| import android.graphics.Paint; | |
| import android.graphics.drawable.BitmapDrawable; | |
| import android.media.MediaScannerConnection; | |
| import android.net.Uri; |