This repository has been archived by the owner on Jul 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from geeeeeeeeek/milestone/2.0
Milestone/2.0 Ready to Merge
- Loading branch information
Showing
27 changed files
with
611 additions
and
137 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
70 changes: 70 additions & 0 deletions
70
app/src/main/java/xyz/monkeytong/hongbao/activities/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,70 @@ | ||
package xyz.monkeytong.hongbao.activities; | ||
|
||
import android.content.Intent; | ||
import android.net.Uri; | ||
import android.os.Bundle; | ||
import android.preference.Preference; | ||
import android.preference.PreferenceActivity; | ||
import android.provider.Settings; | ||
import android.view.View; | ||
import xyz.monkeytong.hongbao.R; | ||
import xyz.monkeytong.hongbao.utils.UpdateTask; | ||
|
||
/** | ||
* Created by Zhongyi on 1/19/16. | ||
* Settings page. | ||
*/ | ||
public class SettingsActivity extends PreferenceActivity { | ||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
|
||
loadUI(); | ||
setPrefListeners(); | ||
} | ||
|
||
private void setPrefListeners() { | ||
// Check for updates | ||
Preference updatePref = findPreference("pref_etc_check_update"); | ||
updatePref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { | ||
public boolean onPreferenceClick(Preference preference) { | ||
new UpdateTask(getApplicationContext(),true).update(); | ||
return false; | ||
} | ||
}); | ||
|
||
// Open issue | ||
Preference issuePref = findPreference("pref_etc_issue"); | ||
issuePref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { | ||
public boolean onPreferenceClick(Preference preference) { | ||
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/geeeeeeeeek/WeChatLuckyMoney/issues")); | ||
browserIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | ||
SettingsActivity.this.startActivity(browserIntent); | ||
return false; | ||
} | ||
}); | ||
} | ||
|
||
private void loadUI() { | ||
addPreferencesFromResource(R.xml.preferences); | ||
|
||
// Get rid of the fucking additional padding | ||
getListView().setPadding(0, 0, 0, 0); | ||
getListView().setBackgroundColor(0xfffaf6f1); | ||
} | ||
|
||
@Override | ||
protected void onResume() { | ||
super.onResume(); | ||
} | ||
|
||
public void performBack(View view) { | ||
super.onBackPressed(); | ||
} | ||
|
||
public void enterAccessibilityPage(View view) { | ||
Intent mAccessibleIntent = | ||
new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS); | ||
startActivity(mAccessibleIntent); | ||
} | ||
} |
Oops, something went wrong.