Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Releases: mddanishansari/Phlex

Phlex v0.0.2

05 Jan 14:02
Compare
Choose a tag to compare

New methods in v0.0.2

  • isPreLollipop()
  • Returns true if device is pre-lollipop
  • Tip: Useful for backward compatibility
  • isLollipopPlus()
  • Returns true if device is lollipop or lollipop plus
  • Tip: Useful for backward compatibility
  • dp2px(int dp)
  • Returns px value of the provided dp
  • You can also use float
  • px2dp(int px)
  • Returns dp value of the provided px
  • You can also use float
  • isAppInstalled(Context context, String appPackageName)
  • Returns true or false

Phlex v0.0.1

05 Jan 13:46
Compare
Choose a tag to compare

Methods available in v0.0.1

  • isFirstRun(SharedPreferences sharedPreferences)
  • Returns true or false
  • isFirstRun(Context context)
  • Returns true or false
  • Uses apps default SharedPreferences file
  • isDataAvailable(Context context)
  • Returns true or false
  • isEmailIdValid(String emailId)
  • Returns true or false
  • isAppVersionUpdated(Context context)
  • Returns true if versionCode of build.gradle is incremented
  • By default returns true on first run.
  • isAppVersionUpdated(Context context, SharedPreferences sharedPreferences)
  • Same as above method it just uses SharedPreferences file provided by user
  • getScreenWidth() or getScreenWidth()
  • Returns integer value
  • getXPercentOfY(int X, int Y)
  • You can also use float, long or double
  • Returns value depending on datatype used
  • getThisFromAssets(Context context, String fileName)
  • Returns contents of files as a String
  • Provide file name with extension like sample.json
  • Tip: Use with text files like *.txt, *.json etc
  • switchfragment(AppCompatActivity activity, View container, Fragment fragment)
  • Switches fragment in the container view
  • switchfragment(AppCompatActivity activity, View container, Fragment fragment, String toolbarTitle)
  • Switches fragment in the container view
  • Also changes the toolbar's title if available
  • setToolbarElevation(Toolbar toolbar, View toolbarShadow, int elevation)
  • Sets toolbar elevation to elevation if device is LOLLIPOP+ and hides toolbarShadow view
  • Else unhides toolbarShadow view
  • Tip: Very useful for backward compatibility