Skip to content

Commit

Permalink
Merge pull request #1186 from nextcloud/material-3
Browse files Browse the repository at this point in the history
feat(theming): Implement Material 3 Theme
  • Loading branch information
David-Development authored Sep 10, 2023
2 parents 49ffee3 + 95f38cf commit f0593ed
Show file tree
Hide file tree
Showing 161 changed files with 598 additions and 711 deletions.
19 changes: 10 additions & 9 deletions News-Android-App/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ plugins {
}

android {
compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)

testOptions.unitTests.includeAndroidResources = true

defaultConfig {
compileSdk Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
minSdkVersion Integer.parseInt(project.ANDROID_BUILD_MIN_SDK_VERSION)
targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)

Expand Down Expand Up @@ -63,7 +62,7 @@ android {
}
}

flavorDimensions "default"
flavorDimensions = ["default"]

productFlavors {
// 100% Open-Source Edition
Expand Down Expand Up @@ -113,14 +112,15 @@ repositories {
includeGroup "com.github.nextcloud"
}
}
maven { url 'https://guardian.github.io/maven/repo-releases' } //needed for com.gu:option:1.3 in Android-DirectoryChooser
maven { url 'https://guardian.github.io/maven/repo-releases' }
//needed for com.gu:option:1.3 in Android-DirectoryChooser
}

final DAGGER_VERSION = '2.46.1'
final GLIDE_VERSION = '4.15.1'
final DAGGER_VERSION = '2.48'
final GLIDE_VERSION = '4.16.0'
final ESPRESSO_VERSION = '3.5.1'
final OKHTTP_VERSION = '4.11.0'
final MOCKITO_VERSION = '5.4.0'
final MOCKITO_VERSION = '5.5.0'
final RETROFIT_VERSION = '2.9.0'

dependencies {
Expand All @@ -136,13 +136,14 @@ dependencies {
implementation 'androidx.annotation:annotation:1.6.0'
implementation "androidx.appcompat:appcompat:1.6.1"
implementation "androidx.preference:preference:1.2.1"
implementation 'androidx.core:core-splashscreen:1.0.0'
implementation "androidx.media:media:1.6.0"

// https://mvnrepository.com/artifact/com.google.android.material/material
implementation "com.google.android.material:material:1.9.0"
implementation "androidx.palette:palette:1.0.0"
implementation "androidx.recyclerview:recyclerview:1.3.1"
implementation "androidx.browser:browser:1.5.0"
implementation "androidx.browser:browser:1.6.0"
implementation "androidx.cardview:cardview:1.0.0"
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
Expand Down Expand Up @@ -176,7 +177,7 @@ dependencies {
implementation 'io.reactivex.rxjava3:rxandroid:3.0.2'
// Because RxAndroid releases are few and far between, it is recommended you also
// explicitly depend on RxJava's latest version for bug fixes and new features.
implementation 'io.reactivex.rxjava3:rxjava:3.1.6'
implementation 'io.reactivex.rxjava3:rxjava:3.1.7'
implementation "com.squareup.retrofit2:adapter-rxjava3:$RETROFIT_VERSION"

implementation "com.squareup.retrofit2:retrofit:$RETROFIT_VERSION"
Expand Down
3 changes: 2 additions & 1 deletion News-Android-App/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/SplashTheme"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true"
tools:replace="android:icon, android:label, android:theme, android:name">

Expand All @@ -36,6 +36,7 @@
<activity
android:name=".NewsReaderListActivity"
android:exported="true"
android:theme="@style/SplashTheme"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
2 changes: 1 addition & 1 deletion News-Android-App/src/main/assets/web.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ body.darkThemeOLED a:visited {
}

body.darkTheme {
background-color: #212121;
background-color: #121212;
color: #ffffff;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class DirectoryChooserActivity extends net.rdrei.android.dirchooser.Direc
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
int theme = R.style.DirectoryChooserTheme;
int theme = R.style.AppTheme;
setTheme(theme);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ public class SubscriptionExpandableListAdapter extends BaseExpandableListAdapter
private ArrayList<AbstractItem> mCategoriesArrayList;
private SparseArray<ArrayList<ConcreteFeedItem>> mItemsArrayList;
private boolean showOnlyUnread = false;
private Integer btn_rating_star_off_normal_holo_light;

private SparseArray<String> starredCountFeeds;
private SparseArray<String> unreadCountFolders;
Expand Down Expand Up @@ -306,14 +305,14 @@ public View getGroupView(final int groupPosition, final boolean isExpanded, View
viewHolder.binding.imgViewExpandableIndicator.setVisibility(View.GONE);
viewHolder.binding.imgViewFavicon.setVisibility(View.VISIBLE);
rotation = 0;
viewHolder.binding.imgViewFavicon.setImageResource(getBtn_rating_star_off_normal_holo_light());
viewHolder.binding.imgViewFavicon.setImageResource(R.drawable.ic_star_border_24dp_theme_aware);
} else if (getChildrenCount( groupPosition ) == 0 ) {
viewHolder.binding.imgViewExpandableIndicator.setVisibility(View.GONE);
viewHolder.binding.imgViewFavicon.setVisibility(View.INVISIBLE);
} else {
viewHolder.binding.imgViewExpandableIndicator.setVisibility(View.VISIBLE);
viewHolder.binding.imgViewFavicon.setVisibility(View.INVISIBLE);
viewHolder.binding.imgViewExpandableIndicator.setImageResource(R.drawable.ic_action_expand_less);
viewHolder.binding.imgViewExpandableIndicator.setImageResource(R.drawable.ic_action_expand_less_24);

if(isExpanded) {
rotation = 180;
Expand Down Expand Up @@ -343,17 +342,6 @@ public View getGroupView(final int groupPosition, final boolean isExpanded, View
}


private int getBtn_rating_star_off_normal_holo_light() {
if(btn_rating_star_off_normal_holo_light == null) {
if(ThemeChooser.getSelectedTheme().equals(ThemeChooser.THEME.LIGHT)) {
btn_rating_star_off_normal_holo_light = R.drawable.ic_action_star_border_light;
} else {
btn_rating_star_off_normal_holo_light = R.drawable.ic_action_star_border_dark;
}
}
return btn_rating_star_off_normal_holo_light;
}

static class GroupHolder {
@NonNull final SubscriptionListItemBinding binding;

Expand Down
Loading

0 comments on commit f0593ed

Please sign in to comment.