mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-04-14 19:56:32 +00:00
Add AboutLibraries & Paperboy
This commit is contained in:
parent
90bcfd7797
commit
aacceab336
9 changed files with 296 additions and 72 deletions
|
|
@ -2,32 +2,32 @@
|
|||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.habitrpg.android.habitica"
|
||||
android:versionCode="1"
|
||||
android:versionName="0.0.1" >
|
||||
android:versionName="0.0.1">
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="11"
|
||||
android:minSdkVersion="13"
|
||||
android:targetSdkVersion="22" />
|
||||
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
|
||||
<uses-permission
|
||||
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
|
||||
android:maxSdkVersion="18" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission
|
||||
android:name="android.permission.READ_EXTERNAL_STORAGE"
|
||||
android:maxSdkVersion="18" />
|
||||
|
||||
<application
|
||||
android:name=".HabiticaApplication"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppTheme"
|
||||
android:name=".HabiticaApplication">
|
||||
android:theme="@style/AppTheme">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:label="@string/app_name" >
|
||||
android:label="@string/app_name"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
</activity>
|
||||
<activity
|
||||
android:name=".prefs.PrefsActivity"
|
||||
android:label="@string/PS_param_title" >
|
||||
android:label="@string/PS_param_title">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
</intent-filter>
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
<activity
|
||||
android:name=".LoginActivity"
|
||||
android:label="@string/LoginActivityName"
|
||||
android:windowSoftInputMode="adjustResize" >
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
</intent-filter>
|
||||
|
|
@ -53,7 +53,7 @@
|
|||
<receiver
|
||||
android:name=".widget.SimpleWidget"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="HabitRPG Simple Widget" >
|
||||
android:label="Habitica Simple Widget">
|
||||
<intent-filter>
|
||||
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
||||
</intent-filter>
|
||||
|
|
@ -72,15 +72,10 @@
|
|||
<activity
|
||||
android:name=".MainActivityNew"
|
||||
android:label="@string/app_name"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize"
|
||||
android:theme="@style/CustomTheme" />
|
||||
|
||||
android:theme="@style/CustomTheme">
|
||||
<!-- <intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>-->
|
||||
</activity>
|
||||
|
||||
<activity android:name=".AboutActivity" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
|
|
|||
|
|
@ -81,9 +81,11 @@
|
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.crashlytics.sdk.android/crashlytics/2.3.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.github.florent37/materialviewpager/1.0.5/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.github.ksoichiro/android-observablescrollview/1.5.2/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.github.negue/paperboy/0d4e14bbb5/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.instabug.library/instabugcore/1.4-SNAPSHOT/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.instabug.library/instabugsupport/1.4-SNAPSHOT/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.jpardogo.materialtabstrip/library/1.1.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.mikepenz/aboutlibraries/5.0.5/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.mikepenz/iconics/1.0.2/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.mikepenz/materialdrawer/3.0.5/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.rengwuxian.materialedittext/library/2.1.4/jars" />
|
||||
|
|
@ -106,50 +108,52 @@
|
|||
</content>
|
||||
<orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" exported="" name="gson-2.2.4" level="project" />
|
||||
<orderEntry type="library" exported="" name="answers-1.2.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="instabugcore-1.4-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" exported="" name="materialdrawer-3.0.5" level="project" />
|
||||
<orderEntry type="library" exported="" name="commons-io-2.4" level="project" />
|
||||
<orderEntry type="library" exported="" name="recyclerview-v7-22.2.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="picasso-2.5.2" level="project" />
|
||||
<orderEntry type="library" exported="" name="library-1.0.16" level="project" />
|
||||
<orderEntry type="library" exported="" name="kenburnsview-1.0.6" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-annotations-22.2.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="retrofit-1.6.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="antlr4-4.4" level="project" />
|
||||
<orderEntry type="library" exported="" name="appcompat-v7-22.2.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="crashlytics-core-2.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="library-1.0-rc0" level="project" />
|
||||
<orderEntry type="library" exported="" name="antlr4-annotations-4.4" level="project" />
|
||||
<orderEntry type="library" exported="" name="antlr-runtime-3.5.2" level="project" />
|
||||
<orderEntry type="library" exported="" name="butterknife-6.1.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="org.abego.treelayout.core-1.0.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="library-1.1.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="adapters-1.0-rc0" level="project" />
|
||||
<orderEntry type="library" exported="" name="library-2.4.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="mimecraft-1.1.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="library-2.1.4" level="project" />
|
||||
<orderEntry type="library" exported="" name="design-22.2.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="aboutlibraries-5.0.5" level="project" />
|
||||
<orderEntry type="library" exported="" name="iconics-1.0.2" level="project" />
|
||||
<orderEntry type="library" exported="" name="kotlin-runtime-0.11.91" level="project" />
|
||||
<orderEntry type="library" exported="" name="org.abego.treelayout.core-1.0.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="library-2.1.4" level="project" />
|
||||
<orderEntry type="library" exported="" name="instabugcore-1.4-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" exported="" name="picasso-2.5.2" level="project" />
|
||||
<orderEntry type="library" exported="" name="paperboy-0d4e14bbb5" level="project" />
|
||||
<orderEntry type="library" exported="" name="commons-io-2.4" level="project" />
|
||||
<orderEntry type="library" exported="" name="retrofit-1.6.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="kenburnsview-1.0.6" level="project" />
|
||||
<orderEntry type="library" exported="" name="library-1.0.16" level="project" />
|
||||
<orderEntry type="library" exported="" name="adapters-1.0-rc0" level="project" />
|
||||
<orderEntry type="library" exported="" name="mimecraft-1.1.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="antlr4-runtime-4.4" level="project" />
|
||||
<orderEntry type="library" exported="" name="antlr4-annotations-4.4" level="project" />
|
||||
<orderEntry type="library" exported="" name="materialviewpager-1.0.5" level="project" />
|
||||
<orderEntry type="library" exported="" name="fabric-1.3.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="library-2.4.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="android-observablescrollview-1.5.2" level="project" />
|
||||
<orderEntry type="library" exported="" name="antlr4-4.4" level="project" />
|
||||
<orderEntry type="library" exported="" name="materialdrawer-3.0.5" level="project" />
|
||||
<orderEntry type="library" exported="" name="gson-2.2.4" level="project" />
|
||||
<orderEntry type="library" exported="" name="crashlytics-core-2.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="antlr-runtime-3.5.2" level="project" />
|
||||
<orderEntry type="library" exported="" name="instabugsupport-1.4-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-annotations-22.2.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="gridlayout-v7-22.2.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="kotlin-stdlib-0.11.91" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-v4-22.2.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="recyclerview-v7-22.2.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="cardview-v7-22.2.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="baseLibrary-1.0-rc0" level="project" />
|
||||
<orderEntry type="library" exported="" name="butterknife-6.1.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="commons-lang3-3.3.2" level="project" />
|
||||
<orderEntry type="library" exported="" name="beta-1.1.2" level="project" />
|
||||
<orderEntry type="library" exported="" name="crouton-1.8.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="guava-17.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="antlr4-runtime-4.4" level="project" />
|
||||
<orderEntry type="library" exported="" name="crashlytics-2.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="materialviewpager-1.0.5" level="project" />
|
||||
<orderEntry type="library" exported="" name="baseLibrary-1.0-rc0" level="project" />
|
||||
<orderEntry type="library" exported="" name="fabric-1.3.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="compiler-1.0-rc0" level="project" />
|
||||
<orderEntry type="library" exported="" name="beta-1.1.2" level="project" />
|
||||
<orderEntry type="library" exported="" name="gridlayout-v7-22.2.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="ST4-4.0.8" level="project" />
|
||||
<orderEntry type="library" exported="" name="library-1.1.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="answers-1.2.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="commons-codec-1.10" level="project" />
|
||||
<orderEntry type="library" exported="" name="kotlin-runtime-0.11.91" level="project" />
|
||||
<orderEntry type="library" exported="" name="commons-lang3-3.3.2" level="project" />
|
||||
<orderEntry type="library" exported="" name="design-22.2.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="instabugsupport-1.4-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" exported="" name="cardview-v7-22.2.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-v4-22.2.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="compiler-1.0-rc0" level="project" />
|
||||
<orderEntry type="library" exported="" name="library-1.0-rc0" level="project" />
|
||||
<orderEntry type="library" exported="" name="crashlytics-2.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="ST4-4.0.8" level="project" />
|
||||
<orderEntry type="library" exported="" name="appcompat-v7-22.2.0" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
31
Habitica/assets/paperboy/changelog.json
Normal file
31
Habitica/assets/paperboy/changelog.json
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
[
|
||||
{
|
||||
"name": "Verison 0.0.2",
|
||||
"items": [
|
||||
{
|
||||
"type": "F",
|
||||
"title": "Ability to add / edit / delete / check Checklists!"
|
||||
},
|
||||
{
|
||||
"type": "B",
|
||||
"title": "Fixed crash while the device is offline"
|
||||
},
|
||||
{
|
||||
"type": "B",
|
||||
"title": "Fixed loading user data, where the tags property was an array instead of an object"
|
||||
},
|
||||
{
|
||||
"type": "I",
|
||||
"title": "Added About and Changelog Views"
|
||||
},
|
||||
{
|
||||
"type": "I",
|
||||
"title": "Animate the value changes in the Bars (HP, MP, XP)"
|
||||
},
|
||||
{
|
||||
"type": "N",
|
||||
"title": "Removed the Changelog Dialog"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
@ -26,6 +26,10 @@ repositories {
|
|||
maven {
|
||||
url "http://dl.bintray.com/florent37/maven"
|
||||
}
|
||||
|
||||
maven {
|
||||
url "https://jitpack.io"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
|
@ -60,7 +64,16 @@ dependencies {
|
|||
compile 'com.rengwuxian.materialedittext:library:2.1.4'
|
||||
|
||||
// Instabug / In-App-Feedback
|
||||
compile 'com.instabug.library:instabugsupport:1+'
|
||||
compile 'com.instabug.library:instabugsupport:+'
|
||||
|
||||
// Changelog Fragment, minSDK 17
|
||||
//compile 'com.github.porokoro.paperboy:paperboy:1.0.0'
|
||||
compile 'com.github.negue:paperboy:0d4e14bbb5'
|
||||
|
||||
// About View for all dependent Libraries, where are using
|
||||
compile('com.mikepenz:aboutlibraries:5.0.5@aar') {
|
||||
transitive = true
|
||||
}
|
||||
}
|
||||
|
||||
android {
|
||||
|
|
|
|||
25
Habitica/res/layout/activity_about.xml
Normal file
25
Habitica/res/layout/activity_about.xml
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/main_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".AboutActivity">
|
||||
|
||||
<android.support.design.widget.TabLayout
|
||||
android:id="@+id/tab_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:elevation="6dp"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
|
||||
|
||||
<android.support.v4.view.ViewPager
|
||||
android:id="@+id/pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_below="@id/tab_layout" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
@ -1,23 +1,29 @@
|
|||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:abc="http://schemas.android.com/apk/res-auto">
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@+id/action_showTestActivity"
|
||||
android:orderInCategory="100"
|
||||
abc:showAsAction="never"
|
||||
android:orderInCategory="101"
|
||||
app:showAsAction="never"
|
||||
android:title="Test Activity"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_showChangelogActivity"
|
||||
android:orderInCategory="102"
|
||||
app:showAsAction="never"
|
||||
android:title="About"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_settings"
|
||||
android:orderInCategory="100"
|
||||
abc:showAsAction="never"
|
||||
app:showAsAction="never"
|
||||
android:title="@string/action_settings"/>
|
||||
<item android:id="@+id/action_logout"
|
||||
android:orderInCategory="98"
|
||||
android:title="@string/logout"/>
|
||||
<item android:id="@+id/action_refresh"
|
||||
android:orderInCategory="99"
|
||||
abc:showAsAction="never"
|
||||
app:showAsAction="never"
|
||||
android:title="@string/action_refresh"/>
|
||||
|
||||
</menu>
|
||||
144
Habitica/src/com/habitrpg/android/habitica/AboutActivity.java
Normal file
144
Habitica/src/com/habitrpg/android/habitica/AboutActivity.java
Normal file
|
|
@ -0,0 +1,144 @@
|
|||
package com.habitrpg.android.habitica;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.design.widget.TabLayout;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.app.FragmentStatePagerAdapter;
|
||||
import android.support.v4.view.ViewPager;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import com.github.porokoro.paperboy.PaperboyFragment;
|
||||
import com.github.porokoro.paperboy.Themes;
|
||||
import com.github.porokoro.paperboy.ViewTypes;
|
||||
import com.mikepenz.aboutlibraries.Libs;
|
||||
import com.mikepenz.aboutlibraries.LibsBuilder;
|
||||
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.InjectView;
|
||||
|
||||
public class AboutActivity extends AppCompatActivity {
|
||||
|
||||
@InjectView(R.id.pager)
|
||||
ViewPager pager;
|
||||
|
||||
@InjectView(R.id.tab_layout)
|
||||
TabLayout tabLayout;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_about);
|
||||
|
||||
ButterKnife.inject(this);
|
||||
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
|
||||
if (actionBar != null) {
|
||||
actionBar.setTitle(R.string.about_title);
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
actionBar.setDisplayShowHomeEnabled(false);
|
||||
actionBar.setDisplayShowTitleEnabled(true);
|
||||
actionBar.setDisplayUseLogoEnabled(false);
|
||||
actionBar.setHomeButtonEnabled(false);
|
||||
}
|
||||
|
||||
tabLayout.setTabGravity(TabLayout.GRAVITY_FILL);
|
||||
|
||||
final PagerAdapter adapter = new PagerAdapter(getSupportFragmentManager(), 2);
|
||||
pager.setAdapter(adapter);
|
||||
pager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
|
||||
|
||||
tabLayout.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||
@Override
|
||||
public void onTabSelected(TabLayout.Tab tab) {
|
||||
pager.setCurrentItem(tab.getPosition());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabUnselected(TabLayout.Tab tab) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabReselected(TabLayout.Tab tab) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
tabLayout.setTabsFromPagerAdapter(adapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle action bar item clicks here. The action bar will
|
||||
// automatically handle clicks on the Home/Up button, so long
|
||||
// as you specify a parent activity in AndroidManifest.xml.
|
||||
int id = item.getItemId();
|
||||
|
||||
//noinspection SimplifiableIfStatement
|
||||
if (id == android.R.id.home) {
|
||||
finish();
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
private class PagerAdapter extends FragmentStatePagerAdapter {
|
||||
int mNumOfTabs;
|
||||
|
||||
public PagerAdapter(FragmentManager fm, int NumOfTabs) {
|
||||
super(fm);
|
||||
this.mNumOfTabs = NumOfTabs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
|
||||
switch (position) {
|
||||
case 0:
|
||||
Fragment tab1 = new LibsBuilder()
|
||||
//Pass the fields of your application to the lib so it can find all external lib information
|
||||
.withFields(R.string.class.getFields())
|
||||
//provide a style (optional) (LIGHT, DARK, LIGHT_DARK_TOOLBAR)
|
||||
.withActivityStyle(Libs.ActivityStyle.LIGHT_DARK_TOOLBAR)
|
||||
.withAboutAppName(getString(R.string.app_name))
|
||||
.withAboutDescription("<h2>Used Libraries</h2>")
|
||||
.withAboutIconShown(true)
|
||||
.withAboutVersionShown(true)
|
||||
.withAboutVersionShownCode(true)
|
||||
.withAboutVersionShownName(true)
|
||||
.withAnimations(true)
|
||||
.fragment();
|
||||
|
||||
return tab1;
|
||||
case 1:
|
||||
PaperboyFragment tab2 = new PaperboyFragment.Builder(AboutActivity.this)
|
||||
.setTheme(Themes.DARK)
|
||||
.setViewType(ViewTypes.HEADER)
|
||||
.setFile("paperboy/changelog.json")
|
||||
.build();
|
||||
|
||||
return tab2;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence getPageTitle(int position) {
|
||||
if(position == 0)
|
||||
return getString(R.string.about_title);
|
||||
|
||||
return getString(R.string.about_changelog);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return mNumOfTabs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.habitrpg.android.habitica;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.databinding.DataBindingUtil;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
|
|
@ -47,6 +48,8 @@ import butterknife.ButterKnife;
|
|||
import butterknife.InjectView;
|
||||
|
||||
public class MainActivityNew extends InstabugAppCompatActivity {
|
||||
static final int ABOUT = 12;
|
||||
|
||||
//region View Elements
|
||||
@InjectView(R.id.materialViewPager)
|
||||
MaterialViewPager materialViewPager;
|
||||
|
|
@ -61,9 +64,6 @@ public class MainActivityNew extends InstabugAppCompatActivity {
|
|||
|
||||
List<HabitItem> TaskList = new ArrayList<HabitItem>();
|
||||
|
||||
|
||||
Random r = new Random();
|
||||
|
||||
// just to test the view
|
||||
public static HabitRPGUser User = null;
|
||||
|
||||
|
|
@ -138,7 +138,7 @@ public class MainActivityNew extends InstabugAppCompatActivity {
|
|||
new DividerDrawerItem(),
|
||||
new SecondaryDrawerItem().withName("News"),
|
||||
new SecondaryDrawerItem().withName("Settings"),
|
||||
new SecondaryDrawerItem().withName("About")
|
||||
new SecondaryDrawerItem().withName("About").withIdentifier(ABOUT)
|
||||
|
||||
)
|
||||
.withHeader(sidebarHeaderView)
|
||||
|
|
@ -149,6 +149,13 @@ public class MainActivityNew extends InstabugAppCompatActivity {
|
|||
public boolean onItemClick(AdapterView<?> parent, View view, int position, long id, IDrawerItem drawerItem) {
|
||||
// do something with the clicked item :D
|
||||
|
||||
switch (drawerItem.getIdentifier()) {
|
||||
case ABOUT:
|
||||
startActivity(new Intent(MainActivityNew.this, AboutActivity.class));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import java.lang.reflect.InvocationTargetException;
|
|||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
|
||||
import com.habitrpg.android.habitica.ChangeLogDialog;
|
||||
import com.habitrpg.android.habitica.HostConfig;
|
||||
import com.habitrpg.android.habitica.R;
|
||||
|
||||
|
|
@ -53,8 +52,8 @@ public class PrefsActivity extends PreferenceActivity {
|
|||
addPreferencesFromResource(R.xml.app_prefs_cat2);
|
||||
this.findPreference(this.getString(R.string.SP_last_seen_version)).setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
ChangeLogDialog _ChangelogDialog = new ChangeLogDialog(PrefsActivity.this);
|
||||
_ChangelogDialog.show();
|
||||
//ChangeLogDialog _ChangelogDialog = new ChangeLogDialog(PrefsActivity.this);
|
||||
//_ChangelogDialog.show( getSupportFragmentManager());
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
|
@ -86,8 +85,8 @@ public class PrefsActivity extends PreferenceActivity {
|
|||
public void onHeaderClick(Header header, int position) {
|
||||
super.onHeaderClick(header, position);
|
||||
if (header.id == R.id.show_changelog) {
|
||||
ChangeLogDialog _ChangelogDialog = new ChangeLogDialog(PrefsActivity.this);
|
||||
_ChangelogDialog.show();
|
||||
//ChangeLogDialog _ChangelogDialog = new ChangeLogDialog(PrefsActivity.this);
|
||||
//_ChangelogDialog.show();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue