mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-18 03:39:00 +00:00
[#26] - Changes proposed by team. Add report a bug button, source code button and small changes and refactorings
This commit is contained in:
parent
8b643ca957
commit
24cc7ea104
3 changed files with 60 additions and 26 deletions
|
|
@ -63,6 +63,40 @@
|
|||
android:background="@android:color/darker_gray"
|
||||
android:layout_marginTop="20sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/googlePlayStoreButton"
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/about.rate_our_app"
|
||||
android:textSize="@dimen/abc_text_size_title_material"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="5sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/reportBug"
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/about.bugreport"
|
||||
android:textSize="@dimen/abc_text_size_title_material"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="20sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/sendFeedback"
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/about.give_us_feedback"
|
||||
android:textSize="@dimen/abc_text_size_title_material"
|
||||
android:layout_marginTop="20sp"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
|
||||
<View
|
||||
android:id="@+id/lineDivider2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@android:color/darker_gray"
|
||||
android:layout_marginTop="5sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sourceCodeLink"
|
||||
android:layout_width="347dp"
|
||||
|
|
@ -70,27 +104,17 @@
|
|||
android:text="@string/about.habitica_open_source"
|
||||
android:textSize="@dimen/abc_text_size_title_material"
|
||||
android:textStyle="bold"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="30sp" />
|
||||
android:layout_marginTop="20sp"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/googlePlayStoreButton"
|
||||
android:layout_width="248dp"
|
||||
android:id="@+id/sourceCodeButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/about.rate_our_app"
|
||||
android:text="@string/about.source_code"
|
||||
android:textSize="@dimen/abc_text_size_title_material"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="20sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/giveUsFeedback"
|
||||
android:layout_width="253dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/about.give_us_feedback"
|
||||
android:textSize="@dimen/abc_text_size_title_material"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="20sp" />
|
||||
|
||||
android:layout_marginTop="2sp"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
|||
|
|
@ -111,9 +111,11 @@
|
|||
<string name="about.title">About</string>
|
||||
<string name="about.libraries">Libraries</string>
|
||||
<string name="about.versionhistory">Version history</string>
|
||||
<string name="about.habitica_open_source">Habitica is an Open Source code and you can find the code clicking here</string>
|
||||
<string name="about.habitica_open_source">Habitica is available as open source software on Github</string>
|
||||
<string name="about.rate_our_app">RATE OUR APP</string>
|
||||
<string name="about.give_us_feedback">Give us Feedback! :-)</string>
|
||||
<string name="about.give_us_feedback">Send us Feedback!</string>
|
||||
<string name="about.bugreport">Report a Bug</string>
|
||||
<string name="about.source_code">Source Code</string>
|
||||
|
||||
<!-- Network Errors -->
|
||||
<string name="network_error_title">Connection Error</string>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public class AboutFragment extends Fragment {
|
|||
private String twitterLink = "https://twitter.com/habitica";
|
||||
|
||||
@OnClick(R.id.sourceCodeLink)
|
||||
public void openSourceCodePage(){
|
||||
public void openSourceCodePageByLabel(){
|
||||
openBrowserLink(androidSourceCodeLink);
|
||||
}
|
||||
|
||||
|
|
@ -32,16 +32,24 @@ public class AboutFragment extends Fragment {
|
|||
openBrowserLink(twitterLink);
|
||||
}
|
||||
|
||||
@OnClick(R.id.giveUsFeedback)
|
||||
public void sendEmailAction(){
|
||||
sendEmail();
|
||||
@OnClick(R.id.sourceCodeButton)
|
||||
public void openSourceCodePageByButton(){
|
||||
openBrowserLink(androidSourceCodeLink);
|
||||
}
|
||||
|
||||
@OnClick(R.id.reportBug)
|
||||
public void sendBugReport(){ sendEmail("[Android] Bugreport"); }
|
||||
|
||||
@OnClick(R.id.sendFeedback)
|
||||
public void sendFeedback(){
|
||||
sendEmail("[Android] Feedback");
|
||||
}
|
||||
|
||||
|
||||
@OnClick(R.id.googlePlayStoreButton)
|
||||
public void openGooglePlay(){
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse("market://details?id=com.example.android"));
|
||||
intent.setData(Uri.parse("market://details?id=com.habitrpg.android.habitica"));
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
|
|
@ -70,12 +78,12 @@ public class AboutFragment extends Fragment {
|
|||
startActivity(launchBrowser);
|
||||
}
|
||||
|
||||
private void sendEmail() {
|
||||
private void sendEmail(String subject) {
|
||||
Intent emailIntent = new Intent(Intent.ACTION_SEND);
|
||||
emailIntent.setData(Uri.parse("mailto:"));
|
||||
emailIntent.setType("text/plain");
|
||||
emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[]{"mobile@habitica.com"});
|
||||
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Habitica Feedback");
|
||||
emailIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
|
||||
emailIntent.putExtra(Intent.EXTRA_TEXT, "MESSAGE");
|
||||
startActivity(Intent.createChooser(emailIntent, "Send mail..."));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue