Commit c8e6a8b2 authored by Robert Hitt's avatar Robert Hitt

Added About page and support for earlier APIs

- About page is currently severely lacking in icons
parent e7a41e06
......@@ -3,12 +3,12 @@ apply plugin: 'android-apt'
apply plugin: 'realm-android'
android {
compileSdkVersion 23
buildToolsVersion "22.0.1"
compileSdkVersion 25
buildToolsVersion '23.0.2'
defaultConfig {
applicationId "srct.whatsopen"
minSdkVersion 16
targetSdkVersion 23
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
......@@ -22,7 +22,7 @@ android {
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
......@@ -31,10 +31,10 @@ dependencies {
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:cardview-v7:23.0.0'
compile 'com.android.support:support-v4:23.0.0'
compile 'com.android.support:recyclerview-v7:23.0.0'
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:cardview-v7:25.1.0'
compile 'com.android.support:support-v4:25.1.0'
compile 'com.android.support:recyclerview-v7:25.0.0'
compile 'io.reactivex:rxandroid:1.2.0'
compile 'io.reactivex:rxjava:1.1.4'
testCompile 'junit:junit:4.12'
......@@ -43,4 +43,5 @@ dependencies {
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
compile 'com.github.daniel-stoneuk:material-about-library:1.3.0'
}
......@@ -18,12 +18,20 @@
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name=".ui.activities.DetailActivity"
android:parentActivityName=".ui.activities.MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".ui.activities.MainActivity"/>
</activity>
<activity android:name=".ui.activities.AboutActivity"
android:parentActivityName=".ui.activities.MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".ui.activities.MainActivity"/>
</activity>
</application>
</manifest>
\ No newline at end of file
package srct.whatsopen.ui.activities;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import com.danielstone.materialaboutlibrary.BuildConfig;
import com.danielstone.materialaboutlibrary.MaterialAboutActivity;
import com.danielstone.materialaboutlibrary.model.MaterialAboutActionItem;
import com.danielstone.materialaboutlibrary.model.MaterialAboutCard;
import com.danielstone.materialaboutlibrary.model.MaterialAboutList;
import com.danielstone.materialaboutlibrary.model.MaterialAboutTitleItem;
import srct.whatsopen.R;
public class AboutActivity extends MaterialAboutActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
protected MaterialAboutList getMaterialAboutList() {
MaterialAboutCard.Builder appCardBuilder = new MaterialAboutCard.Builder();
appCardBuilder.addItem(new MaterialAboutTitleItem.Builder()
.text("What's Open")
.build());
appCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text("Version")
.subText("0.1")
.icon(R.drawable.ic_info_outline_black_24dp)
.build());
MaterialAboutCard.Builder contributorsCardBuilder = new MaterialAboutCard.Builder();
contributorsCardBuilder.title("Contributors");
contributorsCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text("Version 1.0")
.subText("Robert Hitt")
.build());
MaterialAboutCard.Builder aboutCardBuilder = new MaterialAboutCard.Builder();
aboutCardBuilder.title("About");
aboutCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text("What's Open is a GMU SRCT project")
.subText("srct.gmu.edu")
.setOnClickListener(new MaterialAboutActionItem.OnClickListener() {
@Override
public void onClick() {
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse("https://srct.gmu.edu/"));
startActivity(i);
}
})
.build());
aboutCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text("Project Repository")
.subText("git.gmu.edu/srct/whats-open-android")
.setOnClickListener(new MaterialAboutActionItem.OnClickListener() {
@Override
public void onClick() {
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse("https://git.gmu.edu/srct/whats-open-android"));
startActivity(i);
}
})
.build());
return new MaterialAboutList(appCardBuilder.build(), contributorsCardBuilder.build(),
aboutCardBuilder.build());
}
@Override
protected CharSequence getActivityTitle() {
return "About";
}
}
......@@ -75,8 +75,6 @@ public class DetailActivity extends AppCompatActivity implements FacilityView{
return true;
case R.id.action_settings:
return true;
case R.id.action_about:
return true;
default:
return super.onOptionsItemSelected(item);
}
......
package srct.whatsopen.ui.activities;
import android.content.Intent;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
......@@ -68,9 +69,16 @@ public class MainActivity extends AppCompatActivity {
case R.id.action_settings:
return true;
case R.id.action_about:
expandAboutActivity();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
// Opens the About page for the app
private void expandAboutActivity() {
Intent i = new Intent(this, AboutActivity.class);
startActivity(i);
}
}
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M11,17h2v-6h-2v6zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM11,9h2L13,7h-2v2z"/>
</vector>
......@@ -2,7 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:elevation="2dp">
<RelativeLayout android:id="@+id/text_layout"
......
......@@ -13,8 +13,4 @@
app:showAsAction="never"
android:title="Settings"/>
<item
android:id="@+id/action_about"
app:showAsAction="never"
android:title="About"/>
</menu>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:colorControlHighlight">@color/tabButtonPressed</item>
<item name="android:homeAsUpIndicator">@drawable/ic_arrow_back_white</item>
</style>
</resources>
\ No newline at end of file
......@@ -6,7 +6,6 @@
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:colorControlHighlight">@color/tabButtonPressed</item>
<item name="android:homeAsUpIndicator">@drawable/ic_arrow_back_white</item>
</style>
......
......@@ -18,6 +18,7 @@ buildscript {
allprojects {
repositories {
jcenter()
maven { url 'https://jitpack.io' }
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment