This file contains 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
//viewPager | |
/*FragmentPagerAdapter | |
This version of the pager is best for use when there are a handful of typically more static fragments to be paged through, such as a set of tabs. The fragment of each page the user visits will be kept in memory, though its view hierarchy may be destroyed when not visible. This can result in using a significant amount of memory since fragment instances can hold on to an arbitrary amount of state. For larger sets of pages, consider FragmentStatePagerAdapter. | |
*/ | |
/*FragmentStatePagerAdapter: | |
This version of the pager is more useful when there are a large number of pages, working more like a list view. When pages are not visible to the user, their entire fragment may be destroyed, only keeping the saved state of that fragment. This allows the pager to hold on to much less memory associated with each visited page as compared to FragmentPagerAdapter at the cost of potentially more overhead when switching between pages.*/ | |
/*setOffscreenPageLimit(int limit) | |
Set the number of pages |
This file contains 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
<!--Đổi màu item option menu trên toolbar--> | |
<item name="android:actionMenuTextColor">@color/primary</item> |
This file contains 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
<!--animation ripple when click cardview--> | |
<android.support.v7.widget.CardView | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:clickable="true" | |
android:foreground="?android:attr/selectableItemBackground"> | |
This file contains 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
<EditText | |
android:layout_width="0dp" | |
android:layout_height="wrap_content" | |
android:layout_weight="1" | |
android:layout_marginLeft="0dp" | |
android:id="@+id/edt1" | |
style="@style/edt_otp" | |
/> | |
<!--style--> |
This file contains 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
https://fcm.googleapis.com/fcm/send | |
Content-Type:application/json | |
Authorization:key=AIzaSyZ-1u...0GBYzPu7Udno5aA | |
{ | |
"to": "/topics/foo-bar", | |
"data": { | |
"message": "This is a Firebase Cloud Messaging Topic Message!", | |
} | |
} |
This file contains 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
//click từng kí tự | |
private SpannableStringBuilder addClickablePart1(String str) { | |
SpannableStringBuilder ssb = new SpannableStringBuilder(str); | |
String[] array = str.split(" "); | |
int next = 0; | |
int start = 0; | |
for (final String s : array) { | |
start = str.indexOf(s, next); | |
ssb.setSpan(new NonUnderlinedClickableSpan() { | |
@Override |
This file contains 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
//test deeplink | |
//syntax | |
adb shell am start | |
-W -a android.intent.action.VIEW | |
-d <URI> <PACKAGE> | |
//examples: | |
adb shell am start -W -a android.intent.action.VIEW -d "deeplink://screen" <package-name> | |
adb shell am start -W -a android.intent.action.VIEW -d "http://example.tk/customer" <package-name> |
This file contains 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 @interface Component { | |
Class<?>[] modules() default {}; | |
Class<?>[] dependencies() default {}; | |
} | |
public @interface Subcomponent { | |
Class<?>[] modules() default {}; | |
} | |
public @interface Module { |
NewerOlder