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
| Create and show tooltip right above BottomNavigationBar: | |
| val popup = PopupWindow(this@MainActivity).apply { | |
| ItemPopupBinding.inflate(LayoutInflater.from(this@MainActivity)).apply { | |
| contentView = this.root | |
| root.setOnClickListener { | |
| dismiss() | |
| } | |
| } |
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
| #1. Create a file: adb_restart.sh and put these lines in: | |
| #!/bin/sh | |
| adb kill-server | |
| adb start-server | |
| adb devices | |
| #2. Make the bashscript executable: | |
| chmod a+x adb_restart.sh |
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
| <?xml version="1.0" encoding="utf-8"?> | |
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
| package="com.example.loadingview"> | |
| <uses-permission android:name="android.permission.INTERNET" /> | |
| <application | |
| android:allowBackup="true" | |
| android:icon="@mipmap/ic_launcher" | |
| android:label="@string/app_name" |
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
| **MainActivity** | |
| package it.rugaard.circularreveal; | |
| public class MainActivity extends AppCompatActivity { | |
| private boolean isRevealed; | |
| @Override | |
| protected void onCreate(Bundle savedInstanceState) { |
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
| 100% — FF | |
| 95% — F2 | |
| 90% — E6 | |
| 85% — D9 | |
| 80% — CC | |
| 75% — BF | |
| 70% — B3 | |
| 65% — A6 | |
| 60% — 99 |
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 class FizzBuzz { | |
| public static void main(String[] args) { | |
| for (int i = 1; i <= 100; i++) { | |
| if ((i % 5 == 0) && (i % 3 == 0)) { | |
| System.out.println("FizzBuzz"); | |
| } else if (i % 3 == 0) { | |
| System.out.println("Fizz"); | |
| } else if (i % 5 == 0) { | |
| System.out.println("Buzz"); | |
| } else { |
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
| List of good posts about Android screenresolutions: | |
| http://stackoverflow.com/questions/6272384/most-popular-screen-sizes-resolutions-on-android-phones | |
| http://petrnohejl.github.io/Android-Cheatsheet-For-Graphic-Designers/ | |
| More to come... |
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
| Bitmap icon = BitmapFactory.decodeResource(context.getResources(), R.drawable.icon_resource); |
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
| Uri myImageContentUri; // A content Uri to the image you would like to share. | |
| String myAppId = "<Your_Facebook_App_Id>"; | |
| Intent shareIntent = new Intent(); | |
| shareIntent.setAction(Intent.ACTION_SEND); | |
| shareIntent.setType("image/*"); | |
| shareIntent.putExtra(Intent.EXTRA_STREAM, myImageContentUri); | |
| // Include your Facebook App Id for attribution | |
| shareIntent.putExtra("com.facebook.platform.extra.APPLICATION_ID", myAppId); |
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
| // Add code to print out the key hash | |
| try { | |
| PackageInfo info = getPackageManager().getPackageInfo("my.app.packagename", | |
| PackageManager.GET_SIGNATURES); | |
| for (Signature signature : info.signatures) { | |
| MessageDigest md = MessageDigest.getInstance("SHA"); | |
| md.update(signature.toByteArray()); | |
| Log.d("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT)); | |
| } | |
| } catch (PackageManager.NameNotFoundException e) { |
NewerOlder