Skip to content
This repository has been archived by the owner on Sep 17, 2023. It is now read-only.

Commit

Permalink
Officially removed the overflow menu. Now theme changing workd on Ore…
Browse files Browse the repository at this point in the history
…o. Added new files to the repo. The free version now has more themes.
  • Loading branch information
maxieds committed May 3, 2018
1 parent 5592af2 commit 312a905
Show file tree
Hide file tree
Showing 21 changed files with 185 additions and 270 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import android.support.v7.app.NotificationCompat;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.WindowManager;
Expand Down Expand Up @@ -237,17 +236,6 @@ protected void onCreate(Bundle savedInstanceState) {

Toolbar actionBar = (Toolbar) findViewById(R.id.toolbarActionBar);
actionBar.setSubtitle("Portable logging interface v" + String.valueOf(BuildConfig.VERSION_NAME));
if (BuildConfig.PAID_APP_VERSION)
actionBar.inflateMenu(R.menu.paid_theme_menu);
else
actionBar.inflateMenu(R.menu.main_menu);
//actionBar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
// @Override
// public boolean onMenuItemClick(MenuItem mitem) {
// return onOptionsItemSelected(mitem);
// }
//});
//setActionBar(actionBar);
clearStatusIcon(R.id.statusIconUlDl);
getWindow().setTitleColor(getThemeColorVariant(R.attr.actionBarBackgroundColor));
getWindow().setStatusBarColor(getThemeColorVariant(R.attr.colorPrimaryDark));
Expand Down Expand Up @@ -365,21 +353,6 @@ public void onPageScrollStateChanged(int state) {

}

/**
* Sets up the themes changer menu in the paid flavor of the app.
* @param overflowMenu
* @return
*/
@Override
public boolean onCreateOptionsMenu(Menu overflowMenu) {
//super.onCreateOptionsMenu(overflowMenu);
if(BuildConfig.PAID_APP_VERSION)
getMenuInflater().inflate(R.menu.paid_theme_menu, overflowMenu);
else
getMenuInflater().inflate(R.menu.main_menu, overflowMenu);
return true;
}

/**
* Sets the local theme (before the ful UI updating to implement the theme change) based on
* the passed theme text description.
Expand Down Expand Up @@ -480,44 +453,14 @@ public void onClick(DialogInterface dialog, int whichBtn) {

});
dialog.setNegativeButton( "Cancel", null);
dialog.setInverseBackgroundForced(true);
dialog.show();
}

public boolean onOptionsItemSelectedHelper(View view) {
return onOptionsItemSelected((MenuItem) view);
}

/**
* Handles the new theme selections in the paid flavor of the app.
* @param mitem
* @return
*/
@Override
public boolean onOptionsItemSelected(MenuItem mitem) {
//super.onOptionsItemSelected(mitem);
String themeDesc = mitem.getTitle().toString().substring("Theme: ".length());
setLocalTheme(themeDesc);

// store the theme setting for when the app reopens:
SharedPreferences sharedPrefs = getSharedPreferences(LiveLoggerActivity.TAG, Context.MODE_PRIVATE);
SharedPreferences.Editor spEditor = sharedPrefs.edit();
spEditor.putString("ThemeUI", themeDesc);
spEditor.commit();

// finally, apply the theme settings by (essentially) restarting the activity UI:
onCreate(localSavedInstanceState);

if(selectedThemeMenuItem != null) {
selectedThemeMenuItem.setIcon(R.drawable.thememarker24);
}
mitem.setChecked(true);
mitem.setEnabled(true);
mitem.setIcon(R.drawable.themecheck24);

appendNewLog(LogEntryMetadataRecord.createDefaultEventRecord("THEME", "New theme installed: " + themeDesc));
return true;
}

/**
* Handles newly attached / detached USB devices.
* @param intent
Expand Down
Binary file added app/src/main/res/drawable/binaryfile2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/brainchip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/bug.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/chipbrain2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/coding2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/ellipsisbracket.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/programmer2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/qr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/settingsgear24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/settingsgears24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/uploadbutton16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
184 changes: 184 additions & 0 deletions app/src/main/res/layout/theme_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent">

<RadioGroup
android:id="@+id/themeRadioGroup"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<RadioButton
android:id="@+id/themeRadioButtonAmber"
android:buttonTint="?colorPrimaryDark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:drawableLeft="@drawable/thememarker24"
android:drawablePadding="5dp"
android:text="Theme: Amber" />

<RadioButton
android:id="@+id/themeRadioButtonAtlanta"
android:buttonTint="?colorPrimaryDark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:drawableLeft="@drawable/thememarker24"
android:drawablePadding="5dp"
android:text="Theme: Atlanta" />

<RadioButton
android:id="@+id/themeRadioButtonBlack"
android:buttonTint="?colorPrimaryDark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:drawableLeft="@drawable/thememarker24"
android:drawablePadding="5dp"
android:text="Theme: Black" />

<RadioButton
android:id="@+id/themeRadioButtonBlue"
android:buttonTint="?colorPrimaryDark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:drawableLeft="@drawable/thememarker24"
android:drawablePadding="5dp"
android:text="Theme: Blue" />

<RadioButton
android:id="@+id/themeRadioButtonChicky"
android:buttonTint="?colorPrimaryDark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:drawableLeft="@drawable/thememarker24"
android:drawablePadding="5dp"
android:text="Theme: Chicky" />

<RadioButton
android:id="@+id/themeRadioButtonChocolate"
android:buttonTint="?colorPrimaryDark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:drawableLeft="@drawable/thememarker24"
android:drawablePadding="5dp"
android:text="Theme: Chocolate" />

<RadioButton
android:id="@+id/themeRadioButtonGoldenrod"
android:buttonTint="?colorPrimaryDark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:drawableLeft="@drawable/thememarker24"
android:drawablePadding="5dp"
android:text="Theme: Goldenrod" />

<RadioButton
android:id="@+id/themeRadioButtonStdGreen"
android:buttonTint="?colorPrimaryDark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:drawableLeft="@drawable/thememarker24"
android:drawablePadding="5dp"
android:text="Theme: Standard Green" />

<RadioButton
android:id="@+id/themeRadioButtonLightblue"
android:buttonTint="?colorPrimaryDark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:drawableLeft="@drawable/thememarker24"
android:drawablePadding="5dp"
android:text="Theme: Lightblue" />

<RadioButton
android:id="@+id/themeRadioButtonLinuxGOB"
android:buttonTint="?colorPrimaryDark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:drawableLeft="@drawable/thememarker24"
android:drawablePadding="5dp"
android:text="Theme: Linux Green On Black" />

<RadioButton
android:id="@+id/themeRadioButtonPurple"
android:buttonTint="?colorPrimaryDark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:drawableLeft="@drawable/thememarker24"
android:drawablePadding="5dp"
android:text="Theme: Purple" />

<RadioButton
android:id="@+id/themeRadioButtonRed"
android:buttonTint="?colorPrimaryDark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:drawableLeft="@drawable/thememarker24"
android:drawablePadding="5dp"
android:text="Theme: Red" />

<RadioButton
android:id="@+id/themeRadioButtonRedmond"
android:buttonTint="?colorPrimaryDark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:drawableLeft="@drawable/thememarker24"
android:drawablePadding="5dp"
android:text="Theme: Redmond" />

<RadioButton
android:id="@+id/themeRadioButtonTeal"
android:buttonTint="?colorPrimaryDark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:drawableLeft="@drawable/thememarker24"
android:drawablePadding="5dp"
android:text="Theme: Teal" />

<RadioButton
android:id="@+id/themeRadioButtonUrbanaDesfire"
android:buttonTint="?colorPrimaryDark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:drawableLeft="@drawable/thememarker24"
android:drawablePadding="5dp"
android:text="Theme: Urbana Desfire" />

<RadioButton
android:id="@+id/themeRadioButtonWhite"
android:buttonTint="?colorPrimaryDark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:drawableLeft="@drawable/thememarker24"
android:drawablePadding="5dp"
android:text="Theme: White" />

<RadioButton
android:id="@+id/themeRadioButtonWinter"
android:buttonTint="?colorPrimaryDark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:drawableLeft="@drawable/thememarker24"
android:drawablePadding="5dp"
android:text="Theme: Winter" />

</RadioGroup>

</android.support.constraint.ConstraintLayout>
57 changes: 0 additions & 57 deletions app/src/main/res/menu/main_menu.xml

This file was deleted.

Loading

0 comments on commit 312a905

Please sign in to comment.