Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
jami-client-android
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
145
Issues
145
List
Boards
Labels
Service Desk
Milestones
Iterations
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
savoirfairelinux
jami-client-android
Commits
41f7c193
Commit
41f7c193
authored
Aug 13, 2020
by
Adrien Béraud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
migration: allow to delete account
Change-Id: I456416a5ac76825dfd2774d0f7b1b8897d57f396
parent
496e49a8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
25 deletions
+53
-25
ring-android/app/src/main/java/cx/ring/fragments/AccountMigrationFragment.java
...main/java/cx/ring/fragments/AccountMigrationFragment.java
+19
-3
ring-android/app/src/main/res/layout/frag_account_migration.xml
...ndroid/app/src/main/res/layout/frag_account_migration.xml
+34
-22
No files found.
ring-android/app/src/main/java/cx/ring/fragments/AccountMigrationFragment.java
View file @
41f7c193
...
...
@@ -90,6 +90,7 @@ public class AccountMigrationFragment extends Fragment {
});
binding
.
ringMigrateBtn
.
setOnClickListener
(
v
->
initAccountMigration
(
binding
.
ringPassword
.
getText
().
toString
()));
binding
.
deleteBtn
.
setOnClickListener
(
v
->
initAccountDelete
());
}
@Override
...
...
@@ -100,11 +101,26 @@ public class AccountMigrationFragment extends Fragment {
}
}
private
void
initAccount
Migration
(
String
password
)
{
if
(
migratingAccount
)
{
private
void
initAccount
Delete
(
)
{
if
(
migratingAccount
)
return
;
}
new
MaterialAlertDialogBuilder
(
requireContext
())
.
setTitle
(
R
.
string
.
account_delete_dialog_title
)
.
setMessage
(
R
.
string
.
account_delete_dialog_message
)
.
setNegativeButton
(
android
.
R
.
string
.
cancel
,
null
)
.
setPositiveButton
(
R
.
string
.
menu_delete
,
(
d
,
w
)
->
deleteAccount
())
.
create
()
.
show
();
}
private
void
deleteAccount
()
{
mAccountService
.
removeAccount
(
mAccountId
);
}
private
void
initAccountMigration
(
String
password
)
{
if
(
migratingAccount
)
return
;
migratingAccount
=
true
;
//orientation is locked during the migration of account to avoid the destruction of the thread
...
...
ring-android/app/src/main/res/layout/frag_account_migration.xml
View file @
41f7c193
...
...
@@ -33,7 +33,7 @@ along with this program; if not, write to the Free Software
android:descendantFocusability=
"beforeDescendants"
android:focusableInTouchMode=
"true"
android:orientation=
"vertical"
app:bounded_width=
"3
2
0dp"
>
app:bounded_width=
"3
8
0dp"
>
<androidx.cardview.widget.CardView
android:layout_width=
"match_parent"
...
...
@@ -57,36 +57,48 @@ along with this program; if not, write to the Free Software
android:contentDescription=
"@string/app_name"
app:srcCompat=
"@drawable/ic_jami_48"
/>
<LinearLayout
<com.google.android.material.textfield.TextInputLayout
android:id=
"@+id/password_layout"
android:layout_width=
"match_parent"
android:layout_height=
"
match_par
ent"
android:layout_height=
"
wrap_cont
ent"
android:layout_below=
"@id/textView"
android:orientation=
"vertical"
>
android:layout_margin=
"16dp"
app:passwordToggleEnabled=
"true"
>
<com.google.android.material.textfield.TextInputLayout
<com.google.android.material.textfield.TextInputEditText
android:id=
"@+id/ring_password"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:paddingLeft=
"16dp"
android:paddingRight=
"16dp"
app:passwordToggleEnabled=
"true"
>
<com.google.android.material.textfield.TextInputEditText
android:id=
"@+id/ring_password"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:hint=
"@string/account_enter_password"
android:imeOptions=
"actionDone"
android:inputType=
"textPassword"
/>
</com.google.android.material.textfield.TextInputLayout>
android:hint=
"@string/account_enter_password"
android:imeOptions=
"actionDone"
android:inputType=
"textPassword"
/>
</com.google.android.material.textfield.TextInputLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_below=
"@id/password_layout"
android:orientation=
"horizontal"
android:layout_margin=
"8dp"
>
<com.google.android.material.button.MaterialButton
android:id=
"@+id/
ring_migra
te_btn"
android:id=
"@+id/
dele
te_btn"
style=
"@style/Widget.MaterialComponents.Button.TextButton.Dialog.Flush"
android:layout_width=
"wrap_content"
android:layout_height=
"0dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_weight=
"1"
android:text=
"@string/menu_delete"
android:textColor=
"@color/red_800"
/>
<com.google.android.material.button.MaterialButton
android:id=
"@+id/ring_migrate_btn"
style=
"@style/Widget.MaterialComponents.Button.TextButton.Dialog.Flush"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:text=
"@string/update_account"
/>
android:layout_weight=
"1"
android:text=
"@string/update_account"
/>
</LinearLayout>
<TextView
...
...
@@ -98,7 +110,7 @@ along with this program; if not, write to the Free Software
android:paddingLeft=
"16dp"
android:paddingTop=
"16dp"
android:paddingRight=
"16dp"
android:paddingBottom=
"
24
dp"
android:paddingBottom=
"
16
dp"
android:text=
"@string/account_migration"
android:textSize=
"14sp"
/>
...
...
@@ -113,7 +125,7 @@ along with this program; if not, write to the Free Software
android:paddingTop=
"24dp"
android:paddingRight=
"16dp"
android:text=
"@string/ring_account"
android:textAppearance=
"@style/TextAppearance.MaterialComponents.Headline5"
/>
android:textAppearance=
"@style/TextAppearance.MaterialComponents.Headline5"
/>
</RelativeLayout>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment