-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added settings menu to customize colors
- Loading branch information
Showing
12 changed files
with
129 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
app/src/main/java/com/leapwill/plainnote/SettingsActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.leapwill.plainnote; | ||
|
||
import android.app.Activity; | ||
import android.os.Bundle; | ||
|
||
public class SettingsActivity extends Activity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
getFragmentManager().beginTransaction() | ||
.replace(android.R.id.content, SettingsFragment.newInstance()) | ||
.commit(); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
app/src/main/java/com/leapwill/plainnote/SettingsFragment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.leapwill.plainnote; | ||
|
||
import android.content.Context; | ||
import android.content.res.Resources; | ||
import android.net.Uri; | ||
import android.os.Bundle; | ||
import android.preference.PreferenceFragment; | ||
import android.support.v4.app.Fragment; | ||
import android.util.Log; | ||
import android.view.ContextThemeWrapper; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
|
||
public class SettingsFragment extends PreferenceFragment { | ||
|
||
public SettingsFragment() { | ||
// Required empty public constructor | ||
} | ||
|
||
public static SettingsFragment newInstance() { | ||
SettingsFragment fragment = new SettingsFragment(); | ||
Bundle args = new Bundle(); | ||
fragment.setArguments(args); | ||
return fragment; | ||
} | ||
|
||
@Override | ||
public void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
addPreferencesFromResource(R.xml.preferences); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<ListView xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context="com.leapwill.plainnote.SettingsFragment" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto"> | ||
|
||
<com.rarepebble.colorpicker.ColorPreference | ||
android:key="plainNotePrefBGColor" | ||
android:title="Background color" | ||
android:defaultValue="#dd222222" | ||
app:colorpicker_selectNoneButtonText="Default" /> | ||
|
||
<com.rarepebble.colorpicker.ColorPreference | ||
android:key="plainNotePrefTextColor" | ||
android:title="Text color" | ||
android:defaultValue="#ffffffff" | ||
app:colorpicker_selectNoneButtonText="Default" | ||
app:colorpicker_showAlpha="false" /> | ||
|
||
</PreferenceScreen> |