About Libraries

This commit is contained in:
Christian Basler 2015-12-27 22:07:44 +01:00
parent fdc2277324
commit 694fa97dce
6 changed files with 54 additions and 0 deletions

View File

@ -36,6 +36,9 @@ dependencies {
compile('com.mikepenz:materialdrawer:3.1.0@aar') {
transitive = true
}
compile('com.mikepenz:aboutlibraries:5.3.4@aar') {
transitive = true
}
compile 'com.mikepenz:iconics:1.6.2@aar'
compile 'com.mikepenz:community-material-typeface:1.1.71@aar'
}

View File

@ -3,9 +3,13 @@ package ch.dissem.apps.abit;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceFragment;
import android.preference.PreferenceManager;
import com.mikepenz.aboutlibraries.Libs;
import com.mikepenz.aboutlibraries.LibsBuilder;
import ch.dissem.apps.abit.synchronization.SyncAdapter;
import static ch.dissem.apps.abit.util.Constants.PREFERENCE_SERVER_POW;
@ -23,6 +27,20 @@ public class SettingsFragment
// Load the preferences from an XML resource
addPreferencesFromResource(R.xml.preferences);
Preference about = findPreference("about");
about.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
new LibsBuilder()
.withActivityStyle(Libs.ActivityStyle.LIGHT_DARK_TOOLBAR)
.withAboutIconShown(true)
.withAboutVersionShown(true)
.withAboutDescription(getString(R.string.about_app))
.start(getActivity());
return true;
}
});
}
@Override

View File

@ -10,4 +10,9 @@
<color name="secondary_text">#727272</color>
<color name="icons">#212121</color>
<color name="divider">#B6B6B6</color>
<!-- Used for AboutLibraries -->
<color name="colorPrimary">@color/primary</color>
<color name="colorPrimaryDark">@color/primary_dark</color>
<color name="colorAccent">@color/accent</color>
</resources>

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="define_jabit"></string>
<!-- Author section -->
<string name="library_jabit_author">Christian Basler</string>
<string name="library_jabit_authorWebsite">dissem.ch</string>
<!-- Library section -->
<string name="library_jabit_libraryName">Jabit</string>
<string name="library_jabit_libraryDescription">Jabit strives to be an easy to use Bitmessage library for Java developers to quickly implement their own Bitmessage clients.</string>
<string name="library_jabit_libraryWebsite">https://github.com/Dissem/Jabit/wiki</string>
<string name="library_jabit_libraryVersion">1.0.0</string>
<!-- OpenSource section -->
<string name="library_jabit_isOpenSource">true</string>
<string name="library_jabit_repositoryLink">https://github.com/Dissem/Jabit</string>
<!-- ClassPath for autoDetect section -->
<string name="library_jabit_classPath">ch.dissem.bitmessage.BitmessageContext</string>
<!-- License section -->
<string name="library_jabit_licenseId">apache_2_0</string>
<!-- Custom variables section -->
</resources>

View File

@ -1,5 +1,6 @@
<resources>
<string name="app_name">Abit</string>
<string name="about_app">A Bitmessage client for Android</string>
<string name="title_message_detail">Message Detail</string>
<string name="title_subscription_detail">Subscription Detail</string>
<string name="bitmessage_full_node">Bitmessage Node</string>
@ -52,4 +53,6 @@
<string name="server_pow">Server POW</string>
<string name="server_pow_summary">Trusted node does proof of work</string>
<string name="full_node_warning">Running a full Bitmessage uses a lot of traffic, which could be expensive on a mobile network. Are you sure you want to start a full node?</string>
<string name="about">About Abit</string>
<string name="about_summary">Open source dependencies.</string>
</resources>

View File

@ -31,4 +31,9 @@
android:title="@string/server_pow"
android:summary="@string/server_pow_summary"
/>
<Preference
android:key="about"
android:title="@string/about"
android:summary="@string/about_summary"
/>
</PreferenceScreen>