mirror of
				https://codeberg.org/tom79/Fedilab.git
				synced 2025-10-20 11:20:16 +03:00 
			
		
		
		
	Some theme fixes with button + fix profile not updated when edited
This commit is contained in:
		
							parent
							
								
									03e30bdfc3
								
							
						
					
					
						commit
						0f4408ba95
					
				
					 7 changed files with 36 additions and 5 deletions
				
			
		| 
						 | 
					@ -46,6 +46,7 @@ import app.fedilab.android.client.mastodon.entities.Account;
 | 
				
			||||||
import app.fedilab.android.client.mastodon.entities.Field;
 | 
					import app.fedilab.android.client.mastodon.entities.Field;
 | 
				
			||||||
import app.fedilab.android.databinding.AccountFieldItemBinding;
 | 
					import app.fedilab.android.databinding.AccountFieldItemBinding;
 | 
				
			||||||
import app.fedilab.android.databinding.ActivityEditProfileBinding;
 | 
					import app.fedilab.android.databinding.ActivityEditProfileBinding;
 | 
				
			||||||
 | 
					import app.fedilab.android.exception.DBException;
 | 
				
			||||||
import app.fedilab.android.helper.Helper;
 | 
					import app.fedilab.android.helper.Helper;
 | 
				
			||||||
import app.fedilab.android.helper.MastodonHelper;
 | 
					import app.fedilab.android.helper.MastodonHelper;
 | 
				
			||||||
import app.fedilab.android.helper.ThemeHelper;
 | 
					import app.fedilab.android.helper.ThemeHelper;
 | 
				
			||||||
| 
						 | 
					@ -190,6 +191,13 @@ public class EditProfileActivity extends BaseActivity {
 | 
				
			||||||
                        binding.avatarProgress.setVisibility(View.GONE);
 | 
					                        binding.avatarProgress.setVisibility(View.GONE);
 | 
				
			||||||
                        BaseMainActivity.accountWeakReference.get().mastodon_account = account;
 | 
					                        BaseMainActivity.accountWeakReference.get().mastodon_account = account;
 | 
				
			||||||
                        Helper.recreateMainActivity(EditProfileActivity.this);
 | 
					                        Helper.recreateMainActivity(EditProfileActivity.this);
 | 
				
			||||||
 | 
					                        new Thread(() -> {
 | 
				
			||||||
 | 
					                            try {
 | 
				
			||||||
 | 
					                                new app.fedilab.android.client.entities.Account(EditProfileActivity.this).insertOrUpdate(BaseMainActivity.accountWeakReference.get());
 | 
				
			||||||
 | 
					                            } catch (DBException e) {
 | 
				
			||||||
 | 
					                                e.printStackTrace();
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                        }).start();
 | 
				
			||||||
                    });
 | 
					                    });
 | 
				
			||||||
        } else if (requestCode == PICK_MEDIA_HEADER && resultCode == RESULT_OK) {
 | 
					        } else if (requestCode == PICK_MEDIA_HEADER && resultCode == RESULT_OK) {
 | 
				
			||||||
            Glide.with(EditProfileActivity.this)
 | 
					            Glide.with(EditProfileActivity.this)
 | 
				
			||||||
| 
						 | 
					@ -203,6 +211,14 @@ public class EditProfileActivity extends BaseActivity {
 | 
				
			||||||
                        sendBroadCast(account);
 | 
					                        sendBroadCast(account);
 | 
				
			||||||
                        binding.headerProgress.setVisibility(View.GONE);
 | 
					                        binding.headerProgress.setVisibility(View.GONE);
 | 
				
			||||||
                        BaseMainActivity.accountWeakReference.get().mastodon_account = account;
 | 
					                        BaseMainActivity.accountWeakReference.get().mastodon_account = account;
 | 
				
			||||||
 | 
					                        new Thread(() -> {
 | 
				
			||||||
 | 
					                            try {
 | 
				
			||||||
 | 
					                                new app.fedilab.android.client.entities.Account(EditProfileActivity.this).insertOrUpdate(BaseMainActivity.accountWeakReference.get());
 | 
				
			||||||
 | 
					                            } catch (DBException e) {
 | 
				
			||||||
 | 
					                                e.printStackTrace();
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                        }).start();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        Helper.recreateMainActivity(EditProfileActivity.this);
 | 
					                        Helper.recreateMainActivity(EditProfileActivity.this);
 | 
				
			||||||
                    });
 | 
					                    });
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -286,7 +302,15 @@ public class EditProfileActivity extends BaseActivity {
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
                    .observe(EditProfileActivity.this, account -> {
 | 
					                    .observe(EditProfileActivity.this, account -> {
 | 
				
			||||||
                        BaseMainActivity.accountWeakReference.get().mastodon_account = account;
 | 
					                        BaseMainActivity.accountWeakReference.get().mastodon_account = account;
 | 
				
			||||||
 | 
					                        new Thread(() -> {
 | 
				
			||||||
 | 
					                            try {
 | 
				
			||||||
 | 
					                                new app.fedilab.android.client.entities.Account(EditProfileActivity.this).insertOrUpdate(BaseMainActivity.accountWeakReference.get());
 | 
				
			||||||
                                sendBroadCast(account);
 | 
					                                sendBroadCast(account);
 | 
				
			||||||
 | 
					                            } catch (DBException e) {
 | 
				
			||||||
 | 
					                                e.printStackTrace();
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                        }).start();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        Toasty.success(EditProfileActivity.this, getString(R.string.profiled_updated), Toasty.LENGTH_LONG).show();
 | 
					                        Toasty.success(EditProfileActivity.this, getString(R.string.profiled_updated), Toasty.LENGTH_LONG).show();
 | 
				
			||||||
                        finish();
 | 
					                        finish();
 | 
				
			||||||
                    });
 | 
					                    });
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -98,7 +98,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <com.google.android.material.button.MaterialButton
 | 
					        <com.google.android.material.button.MaterialButton
 | 
				
			||||||
            android:id="@+id/set_custom_sharing_save"
 | 
					            android:id="@+id/set_custom_sharing_save"
 | 
				
			||||||
            style="@style/Base.Widget.AppCompat.Button.Colored"
 | 
					            style="@style/MyButtonColored"
 | 
				
			||||||
            android:layout_width="match_parent"
 | 
					            android:layout_width="match_parent"
 | 
				
			||||||
            android:layout_height="wrap_content"
 | 
					            android:layout_height="wrap_content"
 | 
				
			||||||
            android:layout_gravity="center"
 | 
					            android:layout_gravity="center"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -114,7 +114,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <com.google.android.material.button.MaterialButton
 | 
					    <com.google.android.material.button.MaterialButton
 | 
				
			||||||
        android:id="@+id/set_proxy_save"
 | 
					        android:id="@+id/set_proxy_save"
 | 
				
			||||||
        style="@style/Base.Widget.AppCompat.Button.Colored"
 | 
					        style="@style/MyButtonColored"
 | 
				
			||||||
        android:layout_width="match_parent"
 | 
					        android:layout_width="match_parent"
 | 
				
			||||||
        android:layout_height="wrap_content"
 | 
					        android:layout_height="wrap_content"
 | 
				
			||||||
        android:layout_gravity="center"
 | 
					        android:layout_gravity="center"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -67,7 +67,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <com.google.android.material.button.MaterialButton
 | 
					        <com.google.android.material.button.MaterialButton
 | 
				
			||||||
            android:id="@+id/list_action"
 | 
					            android:id="@+id/list_action"
 | 
				
			||||||
            style="@style/Widget.MaterialComponents.Button"
 | 
					            style="@style/MyButtonColored"
 | 
				
			||||||
            android:layout_width="36dp"
 | 
					            android:layout_width="36dp"
 | 
				
			||||||
            android:layout_height="36dp"
 | 
					            android:layout_height="36dp"
 | 
				
			||||||
            android:layout_marginStart="12dp"
 | 
					            android:layout_marginStart="12dp"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -55,6 +55,7 @@
 | 
				
			||||||
        android:id="@+id/continue_button"
 | 
					        android:id="@+id/continue_button"
 | 
				
			||||||
        android:layout_width="wrap_content"
 | 
					        android:layout_width="wrap_content"
 | 
				
			||||||
        android:layout_height="wrap_content"
 | 
					        android:layout_height="wrap_content"
 | 
				
			||||||
 | 
					        style="@style/MyButtonColored"
 | 
				
			||||||
        android:text="@string/keepon"
 | 
					        android:text="@string/keepon"
 | 
				
			||||||
        android:textAllCaps="false"
 | 
					        android:textAllCaps="false"
 | 
				
			||||||
        app:layout_constraintBottom_toBottomOf="parent"
 | 
					        app:layout_constraintBottom_toBottomOf="parent"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -80,7 +80,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <androidx.appcompat.widget.AppCompatButton
 | 
					        <androidx.appcompat.widget.AppCompatButton
 | 
				
			||||||
            android:id="@+id/submit_vote"
 | 
					            android:id="@+id/submit_vote"
 | 
				
			||||||
            style="@style/Widget.AppCompat.Button.Colored"
 | 
					            style="@style/MyButtonColored"
 | 
				
			||||||
            android:layout_width="wrap_content"
 | 
					            android:layout_width="wrap_content"
 | 
				
			||||||
            android:layout_height="wrap_content"
 | 
					            android:layout_height="wrap_content"
 | 
				
			||||||
            android:gravity="center"
 | 
					            android:gravity="center"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -192,6 +192,12 @@
 | 
				
			||||||
        <item name="android:minHeight">48dp</item>
 | 
					        <item name="android:minHeight">48dp</item>
 | 
				
			||||||
    </style>
 | 
					    </style>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <style name="MyButtonColored" parent="Base.Widget.AppCompat.Button.Colored">
 | 
				
			||||||
 | 
					        <item name="iconTint">@color/cyanea_accent_dark_reference</item>
 | 
				
			||||||
 | 
					        <item name="strokeColor">@color/cyanea_accent_dark_reference</item>
 | 
				
			||||||
 | 
					        <item name="rippleColor">@color/cyanea_accent_dark_reference</item>
 | 
				
			||||||
 | 
					        <item name="android:backgroundTint">@color/cyanea_accent_dark_reference</item>
 | 
				
			||||||
 | 
					    </style>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <style name="MyOutlinedButton" parent="Widget.MaterialComponents.Button.OutlinedButton">
 | 
					    <style name="MyOutlinedButton" parent="Widget.MaterialComponents.Button.OutlinedButton">
 | 
				
			||||||
        <item name="iconTint">@color/cyanea_accent_dark_reference</item>
 | 
					        <item name="iconTint">@color/cyanea_accent_dark_reference</item>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue