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
It doesn't look like there's anything in the APIs, but the following seems to be working for me. It might need testing. | |
boolean fullyExpanded = | |
(appBarLayout.getHeight() - appBarLayout.getBottom()) == 0; | |
Edit: The above solution does seem to work, but since I wanted to test this condition when the appbar was scrolled, I ended up using the following solution with OnOffsetChangedListener. | |
class Frag extends Fragment implements AppBarLayout.OnOffsetChangedListener { | |
private boolean appBarIsExpanded = true; | |
private AppBarLayout appBarLayout; |
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
As of v27.0, the Android support team has included an ItemTouchHelper class that makes swipe-to-dismiss and drag-and-drop pretty simple. This may not be as full-featured as some of the libraries out there, but it comes directly from the Android team. | |
Update your build.gradle to import v27.+ of the RecyclerView library | |
compile 'com.android.support:recyclerview-v7:27.+' | |
Instantiate an ItemTouchHelper with an appropriate SimpleCallback | |
ItemTouchHelper.SimpleCallback simpleItemTouchCallback = new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT) { | |
[...] | |
@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
WindowManager mgr = (WindowManager) getSystemService(WINDOW_SERVICE); | |
boolean hasSoftKey = Utils.hasSoftKeys(mgr, NPTApplication.this); | |
public static boolean hasSoftKeys(WindowManager windowManager, Context c) { | |
boolean hasSoftwareKeys = true; | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { | |
Display d = windowManager.getDefaultDisplay(); | |
DisplayMetrics realDisplayMetrics = new DisplayMetrics(); |
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
scrollView.getViewTreeObserver().addOnScrollChangedListener(new ViewTreeObserver.OnScrollChangedListener() { | |
@Override | |
public void onScrollChanged() { | |
if (scrollView != null) { | |
if (scrollView.getChildAt(0).getBottom() <= (scrollView.getHeight() + scrollView.getScrollY())) { | |
//scroll view is at bottom | |
} else { | |
//scroll view is not at bottom | |
} | |
} |
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
source: https://www.tenforums.com/tutorials/49586-windows-license-type-determine-if-oem-retail-volume.html | |
Open Command Prompt: type slmgr -dli | |
http://www.makeuseof.com/tag/everything-know-windows-product-keys/ |
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 String getDeviceName() { | |
String manufacturer = Build.MANUFACTURER; | |
String model = Build.MODEL; | |
if (model.startsWith(manufacturer)) { | |
return capitalize(model); | |
} else { | |
return capitalize(manufacturer) + " " + model; | |
} |
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
http://stackoverflow.com/questions/7263291/viewpager-pageradapter-not-updating-the-view | |
There are several ways to achieve this. | |
The first option is easier, but bit more inefficient. | |
Override getItemPosition in your PagerAdapter like this: |
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 static void expand(final View v) { | |
v.measure(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); | |
final int targetHeight = v.getMeasuredHeight(); | |
// Older versions of android (pre API 21) cancel animations for views with a height of 0. | |
v.getLayoutParams().height = 1; | |
v.setVisibility(View.VISIBLE); | |
Animation a = new Animation() | |
{ | |
@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
Download the following ZIPs: | |
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links) | |
Download the correct GApps for your Android version: | |
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip) | |
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip) | |
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip) | |
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip) | |
Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip) |
NewerOlder