Skip to content

Commit

Permalink
feat, refactor: many improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
aikrq committed Dec 24, 2024
1 parent 2684b3b commit 4f60b19
Show file tree
Hide file tree
Showing 37 changed files with 504 additions and 452 deletions.
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ android {
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
Expand Down Expand Up @@ -114,7 +114,7 @@ dependencies {
implementation "androidx.cardview:cardview:1.0.0"
implementation "androidx.viewpager:viewpager:1.0.0"
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
implementation "com.google.android.material:material:1.12.0"
implementation "com.google.android.material:material:1.13.0-alpha09"
implementation "com.airbnb.android:lottie:6.5.2"
implementation "com.google.android.flexbox:flexbox:3.0.0"

Expand All @@ -136,9 +136,9 @@ dependencies {

implementation 'io.coil-kt:coil:2.0.0'
implementation 'io.coil-kt:coil-svg:2.0.0'

minApi26Implementation "com.android.tools.build:bundletool:1.15.6"

//noinspection GradleDependency copied from above dependency for not just runtime access
minApi26Implementation "com.google.protobuf:protobuf-java:3.19.2"
//noinspection GradleDependency
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContracts;
import androidx.annotation.NonNull;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.FileProvider;
import androidx.recyclerview.widget.LinearLayoutManager;
Expand Down Expand Up @@ -2210,9 +2209,6 @@ public void onCreate(Bundle savedInstanceState) {
T = (int) wB.a(getBaseContext(), (float) T);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
findViewById(R.id.layout_main_logo).setVisibility(View.GONE);
getSupportActionBar().setDisplayShowTitleEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
toolbar.setNavigationOnClickListener(v -> {
if (!mB.a()) {
onBackPressed();
Expand All @@ -2222,17 +2218,12 @@ public void onCreate(Bundle savedInstanceState) {
A = ViewConfiguration.get(getContext()).getScaledTouchSlop();
F = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
String stringExtra = getIntent().getStringExtra("event_text");
ActionBar d;
if (C.equals("onCreate")) {
d = getSupportActionBar();
} else if (C.equals("_fab")) {
d = getSupportActionBar();
if (C.equals("_fab")) {
stringExtra = "fab : " + stringExtra;
} else {
d = getSupportActionBar();
stringExtra = ReturnMoreblockManager.getMbName(C) + " : " + stringExtra;
stringExtra = ReturnMoreblockManager.getMbName(C) + ": " + stringExtra;
}
d.setTitle(stringExtra);
toolbar.setSubtitle(stringExtra);
paletteSelector = findViewById(R.id.palette_selector);
paletteSelector.setOnBlockCategorySelectListener(this);
m = findViewById(R.id.palette_block);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ public void onCreate(Bundle savedInstanceState) {
}

Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
findViewById(R.id.layout_main_logo).setVisibility(View.GONE);
getSupportActionBar().setTitle(Helper.getResString(R.string.design_actionbar_title_manager_font));
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowTitleEnabled(true);
toolbar.setNavigationOnClickListener(v -> {
if (!mB.a()) {
onBackPressed();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,6 @@ public void onCreate(Bundle savedInstanceState) {
}
setContentView(R.layout.manage_sound);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
findViewById(R.id.layout_main_logo).setVisibility(View.GONE);
getSupportActionBar().setTitle(getTranslatedString(R.string.design_actionbar_title_manager_sound));
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowTitleEnabled(true);
toolbar.setNavigationOnClickListener(v -> {
if (!mB.a()) {
onBackPressed();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,7 @@ private void updateDeleteIcon(boolean z, boolean isCustomWidget) {
}

private void initialDeleteViewUi() {
int focus = getColor(deleteView, R.attr.colorSurfaceContainer);
int focus = getColor(deleteView, R.attr.colorSurfaceInverse);
int pressed = getColor(deleteView, R.attr.colorOnSurfaceVariant);
rippleRound(deleteView, focus, pressed, 200);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.view.WindowCompat;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;
import androidx.viewpager2.adapter.FragmentStateAdapter;
Expand Down Expand Up @@ -36,8 +37,10 @@ public class AboutActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

binding = ActivityAboutAppBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
WindowCompat.setDecorFitsSystemWindows(getWindow(), false);

binding.toolbar.setNavigationOnClickListener(v -> finish());

Expand Down
11 changes: 2 additions & 9 deletions app/src/main/res/drawable/circle_bg_white.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:innerRadius="0dp"
android:shape="ring"
android:thicknessRatio="2"
android:useLevel="false">
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
<solid android:color="@android:color/white" />
<stroke
android:width="1dp"
android:color="@android:color/white" />
</shape>
</shape>
26 changes: 10 additions & 16 deletions app/src/main/res/layout/about_teamview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="5dp"
android:gravity="center_vertical"
android:clickable="true"
android:background="?selectableItemBackground"
android:clickable="true"
android:gravity="center_vertical"
android:orientation="horizontal">

<LinearLayout
Expand All @@ -40,21 +40,15 @@
android:background="?attr/colorPrimary"
android:orientation="horizontal" />

<androidx.cardview.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/img_user_icon"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
app:cardCornerRadius="22.2dp">

<ImageView
android:id="@+id/img_user_icon"
android:layout_width="45dp"
android:layout_height="45dp"
android:focusable="false"
android:scaleType="centerCrop"
android:src="@drawable/ic_user" />
</androidx.cardview.widget.CardView>
android:scaleType="centerCrop"
android:src="@drawable/ic_user"
app:shapeAppearance="?attr/shapeAppearanceCornerLarge" />

<RelativeLayout
android:layout_width="match_parent"
Expand All @@ -81,11 +75,11 @@
android:layout_below="@+id/tv_user_name"
android:autoLink="all"
android:focusable="false"
android:maxLines="2"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingBottom="8dp"
android:textAppearance="?attr/textAppearanceBodySmall"
android:maxLines="2"
tools:text="Their description" />

<TextView
Expand Down
86 changes: 52 additions & 34 deletions app/src/main/res/layout/activity_about_app.xml
Original file line number Diff line number Diff line change
@@ -1,63 +1,81 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:fitsSystemWindows="true">

<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:navigationIcon="?attr/homeAsUpIndicator"
app:title="@string/about_title" />
android:fitsSystemWindows="true">

<com.google.android.material.tabs.TabLayout
android:id="@+id/tab_layout"
style="@style/TabLayoutStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/toolbar">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="?attr/collapsingToolbarLayoutLargeSize"
android:fitsSystemWindows="true"
app:layout_scrollFlags="scroll|exitUntilCollapsed">

<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/about_team_title" />
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:navigationIcon="?attr/homeAsUpIndicator"
app:title="@string/about_title" />
</com.google.android.material.appbar.CollapsingToolbarLayout>

<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/about_changelog_title" />
android:layout_marginHorizontal="16dp"
android:layout_marginVertical="10dp"
android:clickable="true"
android:focusable="true"
app:cardBackgroundColor="?attr/colorSurfaceContainer"
app:shapeAppearance="?attr/shapeAppearanceCornerExtraLarge"
app:strokeWidth="0.5dp">

<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/about_beta_changes_title" />
</com.google.android.material.tabs.TabLayout>
<com.google.android.material.tabs.TabLayout
android:id="@+id/tab_layout"
style="@style/TabLayoutStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<com.google.android.material.divider.MaterialDivider
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/tab_layout" />
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/about_team_title" />

<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/about_changelog_title" />

<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/about_beta_changes_title" />
</com.google.android.material.tabs.TabLayout>

</com.google.android.material.card.MaterialCardView>
</com.google.android.material.appbar.AppBarLayout>

<androidx.viewpager2.widget.ViewPager2
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/divider" />
app:layout_behavior="@string/appbar_scrolling_view_behavior" />

<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/discordButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_gravity="center|bottom"
android:layout_margin="16dp"
android:text="@string/about_joindiscord"
android:textAllCaps="false"
android:textColor="#FFF"
app:backgroundTint="#5865F2"
app:icon="@drawable/ic_discord"
app:iconTint="#FFF" />
</RelativeLayout>

</androidx.coordinatorlayout.widget.CoordinatorLayout>
33 changes: 20 additions & 13 deletions app/src/main/res/layout/activity_manage_custom_attribute.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:fitsSystemWindows="true">

<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:fitsSystemWindows="true">

<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
<com.google.android.material.appbar.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:navigationIcon="?attr/homeAsUpIndicator"
app:title="Manage Custom Attribute"
app:menu="@menu/manage_custom_attribute_menu" />
android:layout_height="?attr/collapsingToolbarLayoutLargeSize"
android:fitsSystemWindows="true"
app:layout_scrollFlags="scroll|exitUntilCollapsed">

<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:menu="@menu/manage_custom_attribute_menu"
app:navigationIcon="?attr/homeAsUpIndicator"
app:title="Manage Custom Attribute" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>

<LinearLayout
Expand All @@ -38,7 +47,5 @@
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
android:src="@drawable/ic_mtrl_add"
app:elevation="6dp"
app:fabSize="normal" />
android:src="@drawable/ic_mtrl_add" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
Loading

0 comments on commit 4f60b19

Please sign in to comment.