Skip to content
This repository has been archived by the owner on Aug 19, 2018. It is now read-only.

Commit

Permalink
feat: Release 1.2.2
Browse files Browse the repository at this point in the history
Bump up versionCode
  • Loading branch information
EdricChan03 committed Jun 20, 2017
1 parent b908bea commit 9cffbbe
Show file tree
Hide file tree
Showing 15 changed files with 174 additions and 27 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,6 @@ google-services.json
freeline.py
freeline/
freeline_project_description.json

# Changelog
changelog/
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "com.edricchan.myfirstgame"
minSdkVersion 18
targetSdkVersion 25
versionCode 4
versionName "1.2.1"
versionCode 5
versionName "1.2.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
android:theme="@style/PurpleGreenTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
package com.edricchan.myfirstgame;

import android.content.res.Configuration;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatDelegate;
import android.support.v7.widget.Toolbar;
import android.view.MenuInflater;
import android.view.View;
import android.view.ViewGroup;
/**
* A {@link android.preference.PreferenceActivity} which implements and proxies the necessary calls
* to be used with AppCompat.
*
* This technique can be used with an {@link android.app.Activity} class, not just
* {@link android.preference.PreferenceActivity}.
*/
public abstract class AppCompatPreferenceActivity extends PreferenceActivity {
private AppCompatDelegate mDelegate;
@Override
protected void onCreate(Bundle savedInstanceState) {
getDelegate().installViewFactory();
getDelegate().onCreate(savedInstanceState);
super.onCreate(savedInstanceState);
}
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
getDelegate().onPostCreate(savedInstanceState);
}
public ActionBar getSupportActionBar() {
return getDelegate().getSupportActionBar();
}
public void setSupportActionBar(@Nullable Toolbar toolbar) {
getDelegate().setSupportActionBar(toolbar);
}
@Override
public MenuInflater getMenuInflater() {
return getDelegate().getMenuInflater();
}
@Override
public void setContentView(@LayoutRes int layoutResID) {
getDelegate().setContentView(layoutResID);
}
@Override
public void setContentView(View view) {
getDelegate().setContentView(view);
}
@Override
public void setContentView(View view, ViewGroup.LayoutParams params) {
getDelegate().setContentView(view, params);
}
@Override
public void addContentView(View view, ViewGroup.LayoutParams params) {
getDelegate().addContentView(view, params);
}
@Override
protected void onPostResume() {
super.onPostResume();
getDelegate().onPostResume();
}
@Override
protected void onTitleChanged(CharSequence title, int color) {
super.onTitleChanged(title, color);
getDelegate().setTitle(title);
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
getDelegate().onConfigurationChanged(newConfig);
}
@Override
protected void onStop() {
super.onStop();
getDelegate().onStop();
}
@Override
protected void onDestroy() {
super.onDestroy();
getDelegate().onDestroy();
}
public void invalidateOptionsMenu() {
getDelegate().invalidateOptionsMenu();
}
private AppCompatDelegate getDelegate() {
if (mDelegate == null) {
mDelegate = AppCompatDelegate.create(this, null);
}
return mDelegate;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.edricchan.myfirstgame;

import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
Expand All @@ -25,7 +26,8 @@ protected void onCreate(Bundle savedInstanceState) {
toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle("Settings");
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
ActionBar bar = getSupportActionBar();
bar.setDisplayHomeAsUpEnabled(true);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
import android.preference.CheckBoxPreference;
import android.preference.Preference;
import android.preference.PreferenceFragment;
import android.support.annotation.NonNull;
import android.support.v7.app.ActionBar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.support.v7.widget.Toolbar;

/**
* Created by edricchan on 23/5/17.
Expand Down
10 changes: 9 additions & 1 deletion app/src/main/java/com/edricchan/myfirstgame/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v4.app.NotificationCompat;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
Expand All @@ -22,6 +23,7 @@
public class MainActivity extends AppCompatActivity {
private Toolbar toolbar;
private DrawerLayout drawerLayout;

protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Expand All @@ -34,10 +36,15 @@ protected void onCreate(Bundle savedInstanceState) {
actionBar.setDisplayHomeAsUpEnabled(true);
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new MainActivityFragment()).commit();
configureNav();
NotificationCompat.Builder mBuilder1 = new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_numeric_1_box_black_24dp)
.setContentTitle("Dice Roller: Get more achievements")
.setContentText("Click this notification to get a bonus achievement! :)");
}

/**
* Configuration of the sidenav
*
* @return void
* @since 1.2.1
*/
Expand All @@ -51,7 +58,7 @@ public boolean onNavigationItemSelected(MenuItem item) {
Fragment f = null;
int itemId = item.getItemId();

switch(itemId) {
switch (itemId) {
case R.id.one_dice_select:
// TODO: Complete this
f = new MainActivityFragment();
Expand All @@ -78,6 +85,7 @@ public boolean onNavigationItemSelected(MenuItem item) {
}
});
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_main, menu);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.edricchan.myfirstgame;

import android.app.AlertDialog;
import android.support.v7.app.AlertDialog;
import android.content.DialogInterface;
import android.support.v4.app.Fragment;
import android.os.Bundle;
Expand Down Expand Up @@ -152,7 +152,13 @@ public void onClick(DialogInterface dialog, int which) {
out.println("User clicked no.");
}
});
AlertDialog alert1 = builder.create();
final AlertDialog alert1 = builder.create();
alert1.setOnShowListener(new DialogInterface.OnShowListener() {
@Override
public void onShow(DialogInterface dialog) {
alert1.getButton(AlertDialog.BUTTON_NEGATIVE).setTextColor(getResources().getColor(R.color.red));
}
});
alert1.show();
}

Expand Down
7 changes: 4 additions & 3 deletions app/src/main/res/layout/toolbar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:background="@color/colorPrimaryPurple"
android:minHeight="?android:attr/actionBarSize"
android:theme="@style/AppTheme.NoActionBar"
android:theme="@style/PurpleGreenTheme.NoActionBar"
app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp"
app:contentInsetRight="0dp"
app:contentInsetStart="16dp"
app:popupTheme="@style/AppTheme"/>
app:popupTheme="@style/PurpleGreenTheme"
android:elevation="4dp"/>


<FrameLayout
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/menu/menu_main.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<menu 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:theme="@style/AppTheme"
android:theme="@style/PurpleGreenTheme"
tools:context="com.edricchan.myfirstgame.MainActivityFragment">
<item
android:id="@+id/action_settings"
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#9B26AF</color>
<color name="colorPrimaryDark">#7A1EA1</color>
<color name="colorAccent">#68EFAD</color>
<color name="colorPrimaryPurple">#9B26AF</color>
<color name="colorPrimaryPurpleDark">#7A1EA1</color>
<color name="colorAccentGreen">#68EFAD</color>
<color name="white">#FFFFFF</color>
<color name="black">#000000</color>
<color name="red">#FF0000</color>
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
<string name="nav_three">Three Dice</string>
<string name="action_share_app">Share This App</string>
<!--Share dialog-->
<string name="share_intent_value">Share this app to&#8230;</string>
<string name="share_intent_value">Share this app via&#8230;</string>
</resources>
20 changes: 11 additions & 9 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<style name="PurpleGreenTheme" parent="Theme.AppCompat.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="colorPrimary">@color/colorPrimaryPurple</item>
<item name="colorPrimaryDark">@color/colorPrimaryPurpleDark</item>
<item name="colorAccent">@color/colorAccentGreen</item>
<item name="android:homeAsUpIndicator">@color/white</item>
</style>

<style name="AppTheme.NoActionBar" parent="Theme.AppCompat.Light.NoActionBar">
<style name="PurpleGreenTheme.NoActionBar" parent="Theme.AppCompat.Light.NoActionBar">
<item name="windowActionBar">false</item>
<item name="colorControlNormal">@color/white</item>
<item name="android:textColorPrimary">@color/white</item>
<item name="android:textColor">@color/black</item>
<item name="android:textColor">@color/white</item>
<item name="subtitleTextColor">@color/white</item>
</style>

<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>

<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/>
<style name="PurpleGreenTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>

<style name="PurpleGreenTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/>
<style name="AppCompatAlertDialog" parent="Theme.AppCompat.Dialog.Alert">
<item name="colorAccent">@color/colorAccentGreen</item>
</style>
</resources>
28 changes: 26 additions & 2 deletions app/src/main/res/xml/preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,31 @@
android:entries="@array/pref_themes"
android:entryValues="@array/pref_themes_id"
android:key="theme"
android:title="@string/pref_themes_text"
android:summary="@string/pref_themes_summary"/>
android:summary="@string/pref_themes_summary"
android:title="@string/pref_themes_text"/>
</PreferenceCategory>
<PreferenceScreen
android:summary="View more info about the app"
android:title="About">
<Preference
android:summary="View app releases on Github"
android:title="App Version (v1.2.1)">
<intent android:action="android.intent.action.VIEW"
android:data="https://github.com/Chan4077/MyFirstGame/releases"/>
</Preference>
<Preference
android:summary="View source code on Github"
android:title="Github">
<intent
android:action="android.intent.action.VIEW"
android:data="https://github.com/Chan4077/MyFirstGame"/>
</Preference>
<Preference
android:summary="View Chan4077 on Github"
android:title="App author">
<intent
android:action="android.intent.action.VIEW"
android:data="https://github.com/Chan4077"/>
</Preference>
</PreferenceScreen>
</PreferenceScreen>
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
classpath 'com.android.tools.build:gradle:2.3.3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down

0 comments on commit 9cffbbe

Please sign in to comment.