com.mikepenz.aboutlibraries.LibsBuilder Java Examples
The following examples show how to use
com.mikepenz.aboutlibraries.LibsBuilder.
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: SettingsLibs.java From Slide with GNU General Public License v3.0 | 6 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); applyColorTheme(); setContentView(R.layout.activity_settings_libs); setupAppBar(R.id.toolbar, R.string.settings_about_libs, true, true); LibsSupportFragment fragment = new LibsBuilder() .supportFragment(); if (savedInstanceState == null) { getSupportFragmentManager() .beginTransaction() .replace(R.id.root_fragment, fragment) .commit(); } }
Example #2
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 #3
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 #4
Source File: MainActivity.java From Learning-Resources with MIT License | 6 votes |
private void setupViewPager(ViewPager viewPager) { ViewPagerAdapter adapter = new ViewPagerAdapter(getFragmentManager()); ImagesFragment imagesFragment = ImagesFragment.newInstance(2); UploadFragment uploadFragment = UploadFragment.newInstance(); LibsFragment fragment = new LibsBuilder() .withAboutIconShown(true) .withAboutVersionShown(true) .withAboutDescription( "The sample mainly focused on how <b>Retrofit with EventBus</b> can work. " + "This project contains all the API handles. Also some extra utils included. " + "The sample project should be considered in action when you have to architect your own project with the All APIs.<br /><br />" + "One may find this structure bit complex but once got used to it, it'll be the matter of minutes to implement the APIs.<br /><br />" + "<a href='https://github.com/DearDhruv'>https://github.com/DearDhruv</a><br /><br />" + "Application and API created by <b><a href='https://www.linkedin.com/in/deardhruv/'>DearDhruv</a></b>") .fragment(); adapter.addFragment(imagesFragment); adapter.addFragment(uploadFragment); adapter.addFragment(fragment); viewPager.setOffscreenPageLimit(3); viewPager.setAdapter(adapter); }
Example #5
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 #6
Source File: MaoniSampleMainActivity.java From maoni with MIT License | 6 votes |
@Override public boolean onOptionsItemSelected(MenuItem item) { final int itemId = item.getItemId(); if (itemId == android.R.id.home) { onBackPressed(); } else if (itemId == R.id.action_settings) { startActivity(new Intent(this, MaoniSampleSettingsActivity.class)); } else if (itemId == R.id.action_about) { new LibsBuilder() //Pass the fields of your application to the lib so it can find all external lib information .withFields(R.string.class.getFields()) .withActivityTitle(getString(R.string.action_about)) //start the activity .start(this); } return super.onOptionsItemSelected(item); }
Example #7
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 #8
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 #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: 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 #13
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 #14
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 #15
Source File: AboutActivity.java From zapp with MIT License | 5 votes |
@Override public void onCreate(Bundle savedInstanceState) { Intent intent = new LibsBuilder() .withActivityTitle(getString(R.string.activity_about_title)) .withAboutDescription(getString(R.string.aboutLibraries_description_text)) .withFields(R.string.class.getFields()) .withAutoDetect(true) .withLibraries("acra", "commonsio") .withListener(buttonListener) .intent(this); setIntent(intent); super.onCreate(savedInstanceState); }
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: AboutActivity.java From andOTP with MIT License | 5 votes |
@Override public Fragment getItem(int pos) { switch(pos) { case 0: return new AboutFragment(); case 1: return new LibsBuilder() .withFields(R.string.class.getFields()) .withLicenseShown(true) .withVersionShown(true) .supportFragment(); default: return null; } }
Example #19
Source File: AboutActivity.java From timecat with Apache License 2.0 | 5 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_about); setupToolbar("关于", getResources().getColor(R.color.dark_grey_home)); setupStatusBar(getResources().getColor(R.color.dark_grey_home)); if (savedInstanceState == null) { Fragment fragment = new LibsBuilder().withAboutAppName("TimeCat").withAboutIconShown(true).withAboutVersionShown(true).withLicenseShown(true).withLicenseDialog(true).withAboutDescription(getString(R.string.about_description)).fragment(); FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); ft.add(R.id.fragment_holder, fragment).commit(); } }
Example #20
Source File: HomeActivity.java From bleYan with GNU General Public License v2.0 | 4 votes |
@Override public void init(Bundle bundle) { //KitKat translucent modes setTranslucentStatus(this, true); //账号处理 account = new MaterialAccount(this.getResources(), getString(R.string.about_me_name), getString(R.string.about_me_email), R.drawable.profile, R.drawable.header); this.addAccount(account); // set listener this.setAccountListener(this); MaterialSection homeSection = newSection(getString(R.string.app_home), new IconicsDrawable(this) .icon(FontAwesome.Icon.faw_home) .color(Color.WHITE) .sizeDp(24), BleDevicesFragment.newInstance(getString(R.string.app_home))); MaterialSection configSection = newSection(getString(R.string.app_user_config), new IconicsDrawable(this) .icon(FontAwesome.Icon.faw_gg_circle) .color(Color.WHITE) .sizeDp(24), ConfigFragment.newInstance(getString(R.string.app_user_config))); MaterialSection openSourceSection = newSection(getString(R.string.app_open_source), new IconicsDrawable(this) .icon(FontAwesome.Icon.faw_github) .color(Color.WHITE) .sizeDp(24), new LibsBuilder().fragment()); MaterialSection aboutSection = newSection(getString(R.string.app_about), new IconicsDrawable(this) .icon(GoogleMaterial.Icon.gmd_email) .color(Color.WHITE) .sizeDp(24), AboutFragment.newInstance(getString(R.string.app_about))); addSection(homeSection); addSection(configSection); addSection(openSourceSection); addSection(aboutSection); disableLearningPattern(); // add pattern this.setBackPattern(MaterialNavigationDrawer.BACKPATTERN_BACK_TO_FIRST); //allowArrowAnimation(); enableToolbarElevation(); AppUpgrade.update(this);//版本更新 }
Example #21
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 #22
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 #23
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 #24
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); } }