-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
86 additions
and
4 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
17 changes: 17 additions & 0 deletions
17
app/src/main/java/xhinliang/github/io/mdpreference/OriginalActivity.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,17 @@ | ||
package xhinliang.github.io.mdpreference; | ||
|
||
|
||
import android.app.Fragment; | ||
|
||
/** | ||
* Created by xhinliang on 16-3-11. | ||
* original | ||
*/ | ||
public class OriginalActivity extends SingleFragmentActivity { | ||
|
||
|
||
@Override | ||
protected Fragment createFragment() { | ||
return new OriginalFragment(); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
app/src/main/java/xhinliang/github/io/mdpreference/OriginalFragment.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,17 @@ | ||
package xhinliang.github.io.mdpreference; | ||
|
||
import android.os.Bundle; | ||
import android.preference.PreferenceFragment; | ||
|
||
/** | ||
* Created by xhinliang on 16-3-11. | ||
* original | ||
*/ | ||
public class OriginalFragment extends PreferenceFragment { | ||
@Override | ||
public void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
getPreferenceManager().setSharedPreferencesName(getString(R.string.app_name)); | ||
addPreferencesFromResource(R.xml.preference_original); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
app/src/main/java/xhinliang/github/io/mdpreference/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 |
---|---|---|
@@ -1,13 +1,26 @@ | ||
package xhinliang.github.io.mdpreference; | ||
|
||
import android.app.Fragment; | ||
import android.content.SharedPreferences; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.os.Bundle; | ||
|
||
import java.util.Set; | ||
|
||
import io.github.xhinliang.mdpreference.MultiSelectListPreference; | ||
|
||
public class SettingsActivity extends SingleFragmentActivity { | ||
|
||
@Override | ||
protected Fragment createFragment() { | ||
return new SettingsFragment(); | ||
} | ||
|
||
@Override | ||
public void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
SharedPreferences preferences = getSharedPreferences(getString(R.string.app_name), MODE_PRIVATE); | ||
preferences.getString("key_fff", ""); | ||
|
||
} | ||
} |
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,34 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<PreferenceCategory android:title="Alert Settings"> | ||
<CheckBoxPreference | ||
android:key="preference_key_remind_the_same_day11" | ||
android:summary="Alert in the birthday" | ||
android:title="Alert first" /> | ||
<SwitchPreference | ||
android:key="preference_key_remind_the_same_day31" | ||
android:summary="Alert in three day before birthday" | ||
android:title="Alert second" /> | ||
<EditTextPreference | ||
android:key="preference_key_remind_the_same_daywwwd21" | ||
android:summary="Alert in a week before the birthday" | ||
android:title="Alert third" /> | ||
<SwitchPreference | ||
android:key="preference_key_remind_the_same_day341" | ||
android:summary="Alert in two weeks before the birthday" | ||
android:title="Alert fourth" /> | ||
<ListPreference | ||
android:entries="@array/alert_time_entry" | ||
android:entryValues="@array/alert_time_value" | ||
android:key="preference_key_alert_timess1" | ||
android:summary="Select alert time" | ||
android:title="Alert time"/> | ||
<MultiSelectListPreference | ||
android:entries="@array/alert_time_entry" | ||
android:entryValues="@array/alert_time_value" | ||
android:key="preference_key_alert_timeddwexss1" | ||
android:summary="Select alert time" | ||
android:title="Alert time" /> | ||
</PreferenceCategory> | ||
|
||
</PreferenceScreen> |
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