Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Commit 591b7fc

Browse files
authored
app: Moar changes (#55)
-Update gradle plugin -OneUI 4 SwipeRefreshLayout -add getToolbarLayout in SwitchBarActivity -OneUI 4 AboutPage -OneUI 4 TabLayout indicator -OneUI 4 EditText & Dialog colors Signed-off-by: BlackMesa123 <[email protected]>
1 parent f1489a9 commit 591b7fc

40 files changed

+1941
-1074
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
android:icon="@mipmap/ic_launcher"
88
android:label="@string/app_name"
99
android:supportsRtl="true"
10-
android:theme="@style/OneUI4Theme">
10+
android:theme="@style/OneUITheme">
1111

1212
<meta-data
1313
android:name="SamsungBasicInteraction"
@@ -22,13 +22,14 @@
2222
<activity android:name=".SwitchBarActivity" />
2323
<activity
2424
android:name=".AboutActivity"
25-
android:theme="@style/OneUI4AboutTheme" />
25+
android:theme="@style/OneUIAboutTheme" />
2626
<activity
2727
android:name=".MainActivity"
2828
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden" />
2929
<activity
3030
android:name=".SplashActivity"
31-
android:theme="@style/OneUI4SplashTheme">
31+
android:theme="@style/OneUISplashTheme"
32+
android:exported="true">
3233
<intent-filter>
3334
<action android:name="android.intent.action.MAIN" />
3435

@@ -43,4 +44,4 @@
4344
</intent>
4445
</queries>
4546

46-
</manifest>
47+
</manifest>

app/src/main/java/de/dlyt/yanndroid/oneuiexample/SwitchBarActivity.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
package de.dlyt.yanndroid.oneuiexample;
22

33
import android.content.Context;
4+
import android.content.Intent;
45
import android.content.SharedPreferences;
56
import android.os.Bundle;
7+
import android.text.Editable;
8+
import android.widget.EditText;
9+
import android.widget.Toast;
610

711
import androidx.appcompat.app.AppCompatActivity;
812

913
import de.dlyt.yanndroid.oneui.layout.SwitchBarLayout;
14+
import de.dlyt.yanndroid.oneui.layout.ToolbarLayout;
1015
import de.dlyt.yanndroid.oneui.utils.ThemeUtil;
1116
import de.dlyt.yanndroid.oneui.view.Switch;
1217
import de.dlyt.yanndroid.oneui.view.SwitchBar;
@@ -19,6 +24,14 @@ protected void onCreate(Bundle savedInstanceState) {
1924
setContentView(R.layout.activity_switchbar);
2025

2126
SwitchBarLayout switchBarLayout = findViewById(R.id.switchbarlayout_switchbaractivity);
27+
ToolbarLayout toolbarLayout = switchBarLayout.getToolbarLayout();
28+
29+
toolbarLayout.inflateToolbarMenu(R.menu.switchpreferencescreen_menu);
30+
toolbarLayout.setOnToolbarMenuItemClickListener(item -> {
31+
Toast.makeText(this, "Item clicked", Toast.LENGTH_SHORT).show();
32+
return true;
33+
});
34+
2235
switchBarLayout.getSwitchBar().setChecked(getSwitchBarDefaultStatus());
2336
switchBarLayout.getSwitchBar().addOnSwitchChangeListener(this);
2437
}

app/src/main/java/de/dlyt/yanndroid/oneuiexample/tabs/IconsTab.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ public class IconsTab extends Fragment {
226226
R.drawable.ic_samsung_send,
227227
R.drawable.ic_samsung_settings,
228228
R.drawable.ic_samsung_settings_2,
229+
R.drawable.ic_samsung_settings_3,
229230
R.drawable.ic_samsung_share,
230231
R.drawable.ic_samsung_share_2,
231232
R.drawable.ic_samsung_shuffle,
@@ -553,4 +554,4 @@ public void setDivider(Drawable d) {
553554
}
554555

555556
}
556-
}
557+
}

app/src/main/java/de/dlyt/yanndroid/oneuiexample/tabs/NothingTab.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import android.content.Context;
44
import android.os.Bundle;
5+
import android.os.Handler;
56
import android.view.LayoutInflater;
67
import android.view.View;
78
import android.view.ViewGroup;
@@ -39,7 +40,15 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
3940
super.onViewCreated(view, savedInstanceState);
4041

4142
SwipeRefreshLayout swipeRefreshLayout = mRootView.findViewById(R.id.swipe_refresh);
42-
swipeRefreshLayout.setOnRefreshListener(() -> Toast.makeText(mContext, "refreshing", Toast.LENGTH_SHORT).show());
43+
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
44+
@Override
45+
public void onRefresh() {
46+
Toast.makeText(mContext, "Refresh", Toast.LENGTH_SHORT).show();
47+
new Handler().postDelayed(() -> {
48+
swipeRefreshLayout.setRefreshing(false);
49+
}, 700);
50+
}
51+
});
4352

4453
}
45-
}
54+
}

app/src/main/res/layout/activity_main.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
android:id="@+id/drawer_view"
55
android:layout_width="match_parent"
66
android:layout_height="match_parent"
7-
app:drawer_icon="@drawable/ic_samsung_info"
7+
app:drawer_icon="@drawable/ic_samsung_info_2"
88
app:toolbar_title="@string/app_name">
99

1010
<FrameLayout
@@ -21,4 +21,4 @@
2121

2222
<include layout="@layout/content_drawer" />
2323

24-
</de.dlyt.yanndroid.oneui.layout.DrawerLayout>
24+
</de.dlyt.yanndroid.oneui.layout.DrawerLayout>

app/src/main/res/layout/content_drawer.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,21 @@
2626
android:id="@+id/ob1"
2727
android:layout_width="match_parent"
2828
android:layout_height="wrap_content"
29-
app:icon="@drawable/ic_samsung_info"
29+
app:icon="@drawable/ic_samsung_info_2"
3030
app:text="Option 1" />
3131

3232
<de.dlyt.yanndroid.oneui.view.OptionButton
3333
android:id="@+id/ob2"
3434
android:layout_width="match_parent"
3535
android:layout_height="wrap_content"
36-
app:icon="@drawable/ic_samsung_info"
36+
app:icon="@drawable/ic_samsung_info_2"
3737
app:text="Option 2" />
3838

3939
<de.dlyt.yanndroid.oneui.view.OptionButton
4040
android:id="@+id/ob3"
4141
android:layout_width="match_parent"
4242
android:layout_height="wrap_content"
43-
app:icon="@drawable/ic_samsung_info"
43+
app:icon="@drawable/ic_samsung_info_2"
4444
app:text="Option 3" />
4545

4646

@@ -60,7 +60,7 @@
6060
android:id="@+id/ob_help"
6161
android:layout_width="match_parent"
6262
android:layout_height="wrap_content"
63-
app:icon="@drawable/ic_samsung_help"
63+
app:icon="@drawable/ic_samsung_help_2"
6464
app:text="Help" />
6565

6666
<LinearLayout
@@ -86,4 +86,4 @@
8686
</LinearLayout>
8787
</ScrollView>
8888

89-
</LinearLayout>
89+
</LinearLayout>

app/src/main/res/menu/main.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<item
66
android:id="@+id/search"
7-
7+
android:icon="@drawable/ic_samsung_search"
88
android:title="@string/action_search"
99
app:showAsAction="always" />
1010

@@ -29,4 +29,4 @@
2929
android:title="Menu Item 3"
3030
app:showAsAction="never" />
3131

32-
</menu>
32+
</menu>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<menu xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto">
4+
5+
<item
6+
android:id="@+id/edit"
7+
android:title="Edit"
8+
app:showAsAction="always" />
9+
10+
</menu>

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ buildscript {
44
mavenCentral()
55
}
66
dependencies {
7-
classpath 'com.android.tools.build:gradle:4.2.2'
7+
classpath 'com.android.tools.build:gradle:7.0.4'
88
}
99
}
1010

@@ -47,4 +47,4 @@ allprojects {
4747

4848
task clean(type: Delete) {
4949
delete rootProject.buildDir
50-
}
50+
}

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip

0 commit comments

Comments
 (0)