Skip to content

Commit d2f168b

Browse files
SettingsActivity: add delete account button
(it just goes to the web client's account delete flow)
1 parent d129a36 commit d2f168b

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

app/src/main/java/space/myhomework/android/SettingsActivity.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
package space.myhomework.android;
22

33
import androidx.appcompat.app.AppCompatActivity;
4+
5+
import android.content.Intent;
6+
import android.net.Uri;
47
import android.os.Bundle;
8+
import android.view.View;
59

610
public class SettingsActivity extends AppCompatActivity {
711

@@ -10,4 +14,9 @@ protected void onCreate(Bundle savedInstanceState) {
1014
super.onCreate(savedInstanceState);
1115
setContentView(R.layout.activity_settings);
1216
}
17+
18+
public void deleteAccount(View view) {
19+
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://app.myhomework.space/#!settings:requestAccountDeletion"));
20+
startActivity(browserIntent);
21+
}
1322
}
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools"
44
android:layout_width="match_parent"
55
android:layout_height="match_parent"
66
android:paddingBottom="@dimen/activity_vertical_margin"
77
android:paddingLeft="@dimen/activity_horizontal_margin"
88
android:paddingRight="@dimen/activity_horizontal_margin"
99
android:paddingTop="@dimen/activity_vertical_margin"
10+
android:orientation="vertical"
1011
tools:context="space.myhomework.android.SettingsActivity">
1112

13+
<Button
14+
android:layout_width="wrap_content"
15+
android:layout_height="wrap_content"
16+
android:onClick="deleteAccount"
17+
android:text="Delete account" />
18+
1219
<TextView
1320
android:layout_width="wrap_content"
1421
android:layout_height="wrap_content"
15-
android:text="Settings will go here eventually I guess"/>
22+
android:text="Additional settings will go here in the future!" />
1623

17-
</RelativeLayout>
24+
</LinearLayout>

0 commit comments

Comments
 (0)