com.mikepenz.aboutlibraries.Libs Java Examples
The following examples show how to use
com.mikepenz.aboutlibraries.Libs.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MainActivity.java From ZXing-Orient with Apache License 2.0 | 6 votes |
@Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if (id == R.id.about_icon) { new LibsBuilder() .withFields(R.string.class.getFields()) .withActivityStyle(Libs.ActivityStyle.LIGHT_DARK_TOOLBAR) .withActivityTitle(getApplication().getString(R.string.title_about)) .withLicenseShown(true) .withAboutIconShown(true) .withAboutVersionShown(true) .withAboutDescription("This is demo app displaying the features of <b>ZXing-Orient</b> library.") .start(this); return true; } return super.onOptionsItemSelected(item); }
Example #2
Source File: AboutActivity.java From zapp with MIT License | 6 votes |
@Override public boolean onExtraClicked(@NonNull View view, Libs.SpecialButton specialButton) { switch (specialButton) { case SPECIAL1: startActivity(FaqActivity.getStartIntent(AboutActivity.this)); return true; case SPECIAL2: startActivity(ChangelogActivity.getStartIntent(AboutActivity.this)); return true; case SPECIAL3: IntentHelper.sendMail(AboutActivity.this, getString(R.string.support_mail), getString(R.string.activity_about_feedback_mail_subject)); return true; default: return super.onExtraClicked(view, specialButton); } }
Example #3
Source File: AboutActivity.java From GankMeizhi with Apache License 2.0 | 6 votes |
@Override public void onCreate(Bundle savedInstanceState) { setIntent(new LibsBuilder() .withActivityTitle(getResources().getString(R.string.nav_about)) .withActivityStyle(Libs.ActivityStyle.LIGHT_DARK_TOOLBAR) .withAboutAppName(getResources().getString(R.string.app_name)) .withAboutDescription("http://chenyuanming.cn @KeepCoding") .withAboutVersionShown(true) .withAboutIconShown(true) .withAboutVersionShownCode(true) .withAboutVersionShownName(true) .withLicenseShown(true) .intent(this)); super.onCreate(savedInstanceState); }
Example #4
Source File: MainActivity.java From Faker with Apache License 2.0 | 6 votes |
@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.action_about: new LibsBuilder() .withFields(R.string.class.getFields()) .withAutoDetect(true) .withAboutIconShown(true) .withAboutVersionShownName(true) .withAboutAppName("Faker") .withAboutDescription("Provides fake data to your Android apps.") .withActivityTitle("About") .withActivityTheme(R.style.AppTheme) .withActivityStyle(Libs.ActivityStyle.LIGHT_DARK_TOOLBAR) .start(this); return true; } return super.onOptionsItemSelected(item); }
Example #5
Source File: ConfigurationActivity.java From Noyze with Apache License 2.0 | 5 votes |
private void launchAbout(View view) { Intent about = new Intent(getApplicationContext(), NoyzeLibActivity.class); about.putExtra(Libs.BUNDLE_FIELDS, Libs.toStringArray(R.string.class.getFields())); about.putExtra(Libs.BUNDLE_VERSION, true); about.putExtra(Libs.BUNDLE_LICENSE, true); about.putExtra(Libs.BUNDLE_TITLE, getString(R.string.about_settings)); about.putExtra(Libs.BUNDLE_THEME, R.style.AboutTheme); if (null == view) { startActivity(about); } else { ActivityOptionsCompat anim = ActivityOptionsCompat.makeSceneTransitionAnimation(this, view, "Google Plus"); ActivityCompat.startActivity(this, about, anim.toBundle()); } }
Example #6
Source File: MainMapActivity.java From IndiaSatelliteWeather with GNU General Public License v2.0 | 5 votes |
private void showAboutDeveloperPage(Context context) { new LibsBuilder() .withFields(R.string.class.getFields()) .withActivityTitle(getString(R.string.about_heading)) .withActivityStyle(Libs.ActivityStyle.LIGHT_DARK_TOOLBAR) .withLibraries("androidAnnotations") .start(context); WeatherApplication.analyticsHandler.trackScreen(getString(R.string.about_page)); }
Example #7
Source File: AboutActivity.java From conference-app with Apache License 2.0 | 5 votes |
@Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { switch (position) { case 0: //Launch Navigation to the conference site Intent i = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("https://www.google.nl/maps/place/Johan+Huizingalaan+763A,+1066+VH+Amsterdam/@52.3430396,4.8270918,17z/data=!3m1!4b1!4m2!3m1!1s0x47c5e18eae78495d:0x69f2205bc0250fb4")); startActivity(i); break; case 1: // Display the Open Source projects used for this application Intent i1 = new Intent(getApplicationContext(), LibsActivity.class); i1.putExtra(Libs.BUNDLE_FIELDS, Libs.toStringArray(R.string.class.getFields())); i1.putExtra(Libs.BUNDLE_LIBS, new String[]{"OpenCSV", "PrettySharedPreferences"}); i1.putExtra(Libs.BUNDLE_VERSION, true); i1.putExtra(Libs.BUNDLE_LICENSE, true); i1.putExtra(Libs.BUNDLE_TITLE, "Open Source"); i1.putExtra(Libs.BUNDLE_THEME, R.style.AppThemeBar); startActivity(i1); break; case 2: //Open my twitter ;) Intent i2 = new Intent(Intent.ACTION_VIEW); i2.setData(Uri.parse("http://twitter.com/lynfogeek")); startActivity(i2); break; case 3: //Open the feedback form Intent i3 = new Intent(Intent.ACTION_VIEW); i3.setData(Uri.parse("https://docs.google.com/forms/d/1nliavYLhvnAg2CbobJYeOq0HJu6uVO4OxeR4ZqfYVS0/viewform")); startActivity(i3); break; } }
Example #8
Source File: ConfigurationActivity.java From Noyze with Apache License 2.0 | 5 votes |
private void launchAbout(View view) { Intent about = new Intent(getApplicationContext(), NoyzeLibActivity.class); about.putExtra(Libs.BUNDLE_FIELDS, Libs.toStringArray(R.string.class.getFields())); about.putExtra(Libs.BUNDLE_VERSION, true); about.putExtra(Libs.BUNDLE_LICENSE, true); about.putExtra(Libs.BUNDLE_TITLE, getString(R.string.about_settings)); about.putExtra(Libs.BUNDLE_THEME, R.style.AboutTheme); if (null == view) { startActivity(about); } else { ActivityOptionsCompat anim = ActivityOptionsCompat.makeSceneTransitionAnimation(this, view, "Google Plus"); ActivityCompat.startActivity(this, about, anim.toBundle()); } }
Example #9
Source File: SettingsFragment.java From KAM with GNU General Public License v3.0 | 5 votes |
@Override public boolean onPreferenceClick(Preference preference) { switch (preference.getKey()) { case "libraries": LibsBuilder libsBuilder = new LibsBuilder() .withActivityStyle(Libs.ActivityStyle.LIGHT_DARK_TOOLBAR) .withActivityTitle(getString(R.string.open_source_libraries)) .withAboutIconShown(true) .withAboutVersionShown(true) .withAnimations(true); if (!AppHelper.isDarkTheme(getActivity())) { libsBuilder.withActivityTheme(R.style.AboutActivity); } else { libsBuilder.withActivityTheme(R.style.AboutActivityDark); } libsBuilder.start(getActivity()); return true; case "dark_theme": post(); getActivity().recreate(); return true; case "size": new AlertDialog.Builder(getActivity()) .setTitle("Delete Folder?") .setMessage("The Backup File will be deleted!\nAre you sure?") .setPositiveButton("Delete", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { calculateFolderSize(true); } }).setNegativeButton("Nah!", null) .show(); return true; } return false; }
Example #10
Source File: LicenseActivity.java From MLManager with GNU General Public License v3.0 | 5 votes |
@Override public void onCreate(Bundle savedInstanceState) { setIntent(new LibsBuilder() .withActivityTitle(getResources().getString(R.string.settings_license)) .withActivityStyle(Libs.ActivityStyle.LIGHT_DARK_TOOLBAR) .withAutoDetect(true) .intent(this)); super.onCreate(savedInstanceState); }
Example #11
Source File: AboutFragment.java From prayer-times-android with Apache License 2.0 | 5 votes |
public static void libLicences(@NonNull Context ctx) { new LibsBuilder() .withActivityStyle(Libs.ActivityStyle.LIGHT_DARK_TOOLBAR) .withActivityTitle(ctx.getString(R.string.library_licenses)) .withLibraries() .start(ctx); Answers.getInstance().logCustom(new CustomEvent("About") .putCustomAttribute("action", "libLicenses") ); }
Example #12
Source File: BaseActivity.java From LibreTrivia with GNU General Public License v3.0 | 5 votes |
private void onAbout() { String appName = getResources().getString(R.string.app_name); String appDescription = getResources().getString(R.string.app_description); new LibsBuilder() .withActivityStyle(Libs.ActivityStyle.LIGHT_DARK_TOOLBAR) .withAboutIconShown(true) .withAboutAppName(appName) .withAboutVersionShownName(true) .withAboutDescription(appDescription) .start(this); }
Example #13
Source File: ActivityHelper.java From FastAccess with GNU General Public License v3.0 | 5 votes |
public static void startLibs(@NonNull Activity activity) { new LibsBuilder() .withFields(R.string.class.getFields()) .withActivityStyle(Libs.ActivityStyle.LIGHT_DARK_TOOLBAR) .withActivityTheme(R.style.AppTheme) .withAboutIconShown(true) .withAboutVersionShown(true) .withAutoDetect(true) .withLicenseShown(true) .withVersionShown(true) .withActivityTitle(activity.getString(R.string.libs)) .start(activity); }
Example #14
Source File: AboutActivity.java From BottomDialogs with Apache License 2.0 | 5 votes |
@Override public void onCreate(Bundle savedInstanceState) { setIntent(new LibsBuilder() .withActivityStyle(Libs.ActivityStyle.LIGHT_DARK_TOOLBAR) .withActivityTitle(getResources().getString(R.string.action_about)) .withAboutIconShown(true) .withAboutDescription(getResources().getString(R.string.app_description)) .withAboutVersionShown(true) .withAboutAppName(getResources().getString(R.string.app_name)) .withAutoDetect(true) .withLicenseShown(true) .intent(this)); super.onCreate(savedInstanceState); }
Example #15
Source File: AboutFragment.java From prayer-times-android with Apache License 2.0 | 5 votes |
public static void libLicences(@NonNull Context ctx) { new LibsBuilder() .withActivityStyle(Libs.ActivityStyle.LIGHT_DARK_TOOLBAR) .withActivityTitle(ctx.getString(R.string.library_licenses)) .withLibraries() .start(ctx); Answers.getInstance().logCustom(new CustomEvent("About") .putCustomAttribute("action", "libLicenses") ); }
Example #16
Source File: ListActivity.java From haven with GNU General Public License v3.0 | 5 votes |
private void showLicenses () { new LibsBuilder() //provide a style (optional) (LIGHT, DARK, LIGHT_DARK_TOOLBAR) .withActivityStyle(Libs.ActivityStyle.LIGHT_DARK_TOOLBAR) .withAboutIconShown(true) .withAboutVersionShown(true) .withAboutAppName(resourceManager.getString(R.string.app_name)) //start the activity .start(this); }
Example #17
Source File: PreferencesFragment.java From HouSi with Apache License 2.0 | 5 votes |
private void startAboutActivity() { new LibsBuilder() .withAboutIconShown(true) .withAboutVersionShown(true) .withActivityColor(new Colors(getResources().getColor(R.color.colorAccent), getResources().getColor(R.color.colorAccent))) .withAboutSpecial1Description(getString(R.string.aboutLibraries_description_text)) .withAboutAppName(getString(R.string.app_name)) .withActivityTitle(getString(R.string.about_title)) .withActivityStyle(Libs.ActivityStyle.LIGHT_DARK_TOOLBAR) .start(getContext()); }
Example #18
Source File: MainActivity.java From android-app with GNU General Public License v3.0 | 4 votes |
@Override public boolean onNavigationItemSelected(@NonNull MenuItem item) { switch (item.getItemId()) { case R.id.nav_mainLists: setCurrentFragment(FRAGMENT_ARTICLE_LISTS); break; case R.id.nav_tags: setCurrentFragment(FRAGMENT_TAG_LIST); break; case R.id.nav_add: showAddBagDialog(); break; case R.id.nav_settings: startActivity(new Intent(getBaseContext(), SettingsActivity.class)); break; case R.id.nav_about: Libs.ActivityStyle style; switch (Themes.getCurrentTheme()) { case DARK: case DARK_CONTRAST: style = Libs.ActivityStyle.DARK; break; default: style = Libs.ActivityStyle.LIGHT_DARK_TOOLBAR; break; } CharSequence aboutCharSequence = getText(R.string.aboutText); String aboutString = aboutCharSequence instanceof Spanned ? Html.toHtml((Spanned) aboutCharSequence) : aboutCharSequence.toString(); new LibsBuilder() .withActivityStyle(style) .withAboutIconShown(true) .withAboutVersionShown(true) .withAboutDescription(aboutString) .start(this); break; } this.<DrawerLayout>findViewById(R.id.drawer_layout).closeDrawer(GravityCompat.START); return true; }
Example #19
Source File: CurrencyListTabsActivity.java From CryptoBuddy with GNU Affero General Public License v3.0 | 4 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_currency_list_tabs); context = this; mToolbar = findViewById(R.id.toolbar_currency_list); setSupportActionBar(mToolbar); TabLayout tabLayout = findViewById(R.id.currency_list_tabs); mViewPager = findViewById(R.id.currency_list_tabs_container); libsBuilder = new LibsBuilder() //provide a style (optional) (LIGHT, DARK, LIGHT_DARK_TOOLBAR) .withActivityStyle(Libs.ActivityStyle.LIGHT_DARK_TOOLBAR) .withAboutIconShown(true) .withLicenseShown(true) .withVersionShown(true) .withAboutVersionShownName(true) .withAboutVersionShownCode(true) .withAboutVersionString("Version: " + BuildConfig.VERSION_NAME) .withActivityStyle(Libs.ActivityStyle.LIGHT_DARK_TOOLBAR) .withActivityTitle("CryptoBuddy") .withLibraries("easyrest", "materialabout", "androiddevicenames", "customtabs", "togglebuttongroup", "materialfavoritebutton"); TextDrawable t = new TextDrawable(this); t.setText("ART"); t.setTextAlign(Layout.Alignment.ALIGN_CENTER); t.setTextColor(Color.BLACK); t.setTextSize(10); AccountHeader headerResult = new AccountHeaderBuilder() .withActivity(this) .withHeaderBackground(t).build(); drawer = new DrawerBuilder() .withActivity(this) .withToolbar(mToolbar) .withSelectedItem(1) .withAccountHeader(headerResult) .addDrawerItems( new PrimaryDrawerItem().withIdentifier(1).withName(R.string.Home).withIcon(FontAwesome.Icon.faw_home), new PrimaryDrawerItem().withIdentifier(2).withName(R.string.News).withIcon(FontAwesome.Icon.faw_newspaper), new PrimaryDrawerItem().withIdentifier(3).withName("About").withIcon(FontAwesome.Icon.faw_question_circle), new PrimaryDrawerItem().withIdentifier(4).withName("Open Source").withIcon(FontAwesome.Icon.faw_github_square), new PrimaryDrawerItem().withIdentifier(5).withName("Rate on Google Play").withIcon(FontAwesome.Icon.faw_thumbs_up) ) .withTranslucentStatusBar(false) .build(); drawer.setOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener() { @Override public boolean onItemClick(View view, int position, IDrawerItem drawerItem) { switch (position) { case 1: drawer.closeDrawer(); return true; case 2: drawer.closeDrawer(); drawer.setSelection(1); startActivity(new Intent(context, NewsListActivity.class)); return true; case 3: drawer.closeDrawer(); drawer.setSelection(1); startActivity(new Intent(context, AboutTheDevActivity.class)); return true; case 4: drawer.closeDrawer(); drawer.setSelection(1); libsBuilder.start(context); default: return true; } } }); mSectionsPagerAdapter = new SectionsPagerAdapterCurrencyList(getSupportFragmentManager()); mViewPager.setAdapter(mSectionsPagerAdapter); mViewPager.setOffscreenPageLimit(2); mViewPager.addOnPageChangeListener(this); tabLayout.setupWithViewPager(mViewPager); tabLayout.setSelectedTabIndicatorColor(Color.WHITE); }
Example #20
Source File: MainActivity.java From wifi_backend with GNU General Public License v3.0 | 4 votes |
@AfterViews protected void init() { toolbar.setTitle(R.string.app_title); drawer = new DrawerBuilder() .withActivity(this) .withToolbar(toolbar) .withFireOnInitialOnClick(drawerState == null) .withSavedInstance(drawerState) .addDrawerItems( new PrimaryDrawerItem() .withName(R.string.drawer_settings) .withIcon(GoogleMaterial.Icon.gmd_settings) .withIdentifier(SETTINGS), new PrimaryDrawerItem() .withName(R.string.drawer_advanced) .withIcon(GoogleMaterial.Icon.gmd_settings_applications) .withIdentifier(ADVANCED) ) .addStickyDrawerItems( new PrimaryDrawerItem() .withName(R.string.drawer_libraries) .withIcon(GoogleMaterial.Icon.gmd_info_outline) .withSelectable(false) .withIdentifier(LIBRARIES), new PrimaryDrawerItem() .withName(R.string.drawer_website) .withIcon(GoogleMaterial.Icon.gmd_info) .withSelectable(false) .withIdentifier(WEBSITE) ) .withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener() { @Override public boolean onItemClick(View view, int position, IDrawerItem drawerItem) { if (drawerItem != null) { final int id = drawerItem.getIdentifier(); if(id == SETTINGS) { setFragment(new MainSettingsFragment_()); } else if (id == ADVANCED) { setFragment(new AdvancedSettingsFragment_()); } else if (id == LIBRARIES) { new LibsBuilder() .withFields(R.string.class.getFields()) .withActivityStyle(Libs.ActivityStyle.LIGHT_DARK_TOOLBAR) .start(MainActivity.this); } else if (id == WEBSITE) { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(Constants.WEBSITE))); } } return false; } }) .build(); updateTitle(); if(action == Action.request_permission) { drawer.setSelection(SETTINGS); } }
Example #21
Source File: MainActivity.java From Local-GSM-Backend with Apache License 2.0 | 4 votes |
@AfterViews protected void init() { toolbar.setTitle(R.string.app_name); drawer = new DrawerBuilder() .withActivity(this) .withSavedInstance(drawerState) .withToolbar(toolbar) .addDrawerItems( new PrimaryDrawerItem() .withName(R.string.fragment_update_database_title) .withIcon(GoogleMaterial.Icon.gmd_folder) .withIdentifier(DATABASE), new PrimaryDrawerItem() .withName(R.string.fragment_settings_title) .withIcon(GoogleMaterial.Icon.gmd_settings) .withIdentifier(SETTINGS), new PrimaryDrawerItem() .withName(R.string.fragment_settings_advanced_title) .withIcon(GoogleMaterial.Icon.gmd_settings_applications) .withIdentifier(SETTINGS_ADVANCED) ) .addStickyDrawerItems( new PrimaryDrawerItem() .withName(R.string.activity_main_libraries) .withIcon(GoogleMaterial.Icon.gmd_info_outline) .withSelectable(false) .withIdentifier(LIBRARIES), new PrimaryDrawerItem() .withName(R.string.activity_main_about) .withIcon(GoogleMaterial.Icon.gmd_info) .withSelectable(false) .withIdentifier(ABOUT) ) .withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener() { @Override public boolean onItemClick(View view, int position, IDrawerItem drawerItem) { if (drawerItem != null) { final int id = drawerItem.getIdentifier(); if (id == SETTINGS) { setFragment(new SettingsFragment_()); } else if (id == DATABASE) { setFragment(new UpdateDatabaseFragment_()); } else if (id == LIBRARIES) { new LibsBuilder() .withActivityStyle(Libs.ActivityStyle.LIGHT_DARK_TOOLBAR) .withFields(R.string.class.getFields()) .start(MainActivity.this); } else if (id == SETTINGS_ADVANCED) { setFragment(new AdvancedSettingsFragment_()); } else if (id == ABOUT) { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(Config.ABOUT_URL))); } } return false; } }) .withFireOnInitialOnClick(drawerState == null) .build(); updateTitle(); if(action == Action.request_permission) { drawer.setSelection(SETTINGS); } }