summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas <tschneider.ac@gmail.com>2023-01-26 15:39:23 +0100
committerThomas <tschneider.ac@gmail.com>2023-01-26 15:39:23 +0100
commitb94c08d029690d468b07838ecbc6c365f8893f12 (patch)
tree76cf3c86f9ea0672069b7b84f77ed6e50a80b69a
parent42cf16b545635a52694278b489151237ad5242c1 (diff)
some code changes
-rw-r--r--app/src/main/java/app/fedilab/android/peertube/activities/PeertubeMainActivity.java7
-rw-r--r--app/src/main/java/app/fedilab/android/peertube/drawer/AccountsListAdapter.java7
-rw-r--r--app/src/main/res/layouts/peertube/layout/drawer_account_peertube.xml25
-rw-r--r--app/src/main/res/layouts/peertube/layout/drawer_channel_peertube.xml18
-rw-r--r--app/src/main/res/layouts/peertube/layout/drawer_comment_peertube.xml31
-rw-r--r--app/src/main/res/layouts/peertube/layout/drawer_horizontal_account_peertube.xml10
-rw-r--r--app/src/main/res/layouts/peertube/layout/drawer_instance_peertube.xml22
7 files changed, 61 insertions, 59 deletions
diff --git a/app/src/main/java/app/fedilab/android/peertube/activities/PeertubeMainActivity.java b/app/src/main/java/app/fedilab/android/peertube/activities/PeertubeMainActivity.java
index 0d55ea7f3..b96315390 100644
--- a/app/src/main/java/app/fedilab/android/peertube/activities/PeertubeMainActivity.java
+++ b/app/src/main/java/app/fedilab/android/peertube/activities/PeertubeMainActivity.java
@@ -114,7 +114,10 @@ public class PeertubeMainActivity extends PeertubeBaseMainActivity {
public static InstanceData.InstanceConfig instanceConfig;
public static TypeOfConnection typeOfConnection = TypeOfConnection.NORMAL;
public static int badgeCount;
- private DisplayVideosFragment recentFragment, locaFragment, trendingFragment, subscriptionFragment, mostLikedFragment;
+ private DisplayVideosFragment recentFragment;
+ private DisplayVideosFragment locaFragment;
+ private DisplayVideosFragment trendingFragment;
+ private DisplayVideosFragment subscriptionFragment;
private DisplayOverviewFragment overviewFragment;
private ActivityMainPeertubeBinding binding;
@@ -259,7 +262,7 @@ public class PeertubeMainActivity extends PeertubeBaseMainActivity {
bundle.putSerializable(Helper.TIMELINE_TYPE, TimelineVM.TimelineType.SUBSCRIBTIONS);
subscriptionFragment.setArguments(bundle);
- mostLikedFragment = new DisplayVideosFragment();
+ DisplayVideosFragment mostLikedFragment = new DisplayVideosFragment();
bundle = new Bundle();
bundle.putSerializable(Helper.TIMELINE_TYPE, TimelineVM.TimelineType.MOST_LIKED);
mostLikedFragment.setArguments(bundle);
diff --git a/app/src/main/java/app/fedilab/android/peertube/drawer/AccountsListAdapter.java b/app/src/main/java/app/fedilab/android/peertube/drawer/AccountsListAdapter.java
index a114afe23..36d93e88d 100644
--- a/app/src/main/java/app/fedilab/android/peertube/drawer/AccountsListAdapter.java
+++ b/app/src/main/java/app/fedilab/android/peertube/drawer/AccountsListAdapter.java
@@ -18,6 +18,7 @@ import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
+import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
@@ -72,7 +73,7 @@ public class AccountsListAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
viewModel.post(RetrofitPeertubeAPI.ActionType.UNMUTE, account.getAcct(), null).observe((LifecycleOwner) context, apiResponse -> manageVIewPostActions(RetrofitPeertubeAPI.ActionType.UNMUTE, apiResponse, account.getAcct()));
});
} else {
- holder.binding.accountAction.hide();
+ holder.binding.accountAction.setVisibility(View.GONE);
}
holder.binding.accountDn.setText(account.getDisplayName());
@@ -84,8 +85,8 @@ public class AccountsListAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
Helper.loadAvatar(context, account, holder.binding.accountPp);
//Follow button
if (type == RetrofitPeertubeAPI.DataType.MUTED) {
- holder.binding.accountAction.show();
- holder.binding.accountAction.setImageResource(R.drawable.ic_baseline_volume_mute_24);
+ holder.binding.accountAction.setVisibility(View.VISIBLE);
+ holder.binding.accountAction.setIconResource(R.drawable.ic_baseline_volume_mute_24);
}
holder.binding.accountPp.setOnClickListener(v -> {
diff --git a/app/src/main/res/layouts/peertube/layout/drawer_account_peertube.xml b/app/src/main/res/layouts/peertube/layout/drawer_account_peertube.xml
index cb47d8072..1ad54bb28 100644
--- a/app/src/main/res/layouts/peertube/layout/drawer_account_peertube.xml
+++ b/app/src/main/res/layouts/peertube/layout/drawer_account_peertube.xml
@@ -14,8 +14,8 @@
You should have received a copy of the GNU General Public License along with Fedilab; if not,
see <http://www.gnu.org/licenses>.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
+<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -23,14 +23,14 @@
android:layout_marginBottom="5dp"
android:orientation="horizontal">
- <ImageView
+ <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/account_pp"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_gravity="center_horizontal"
android:contentDescription="@string/profile_picture" />
- <LinearLayout
+ <androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/account_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
@@ -38,7 +38,7 @@
android:layout_weight="1"
android:orientation="vertical">
- <TextView
+ <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/account_dn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -46,7 +46,7 @@
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textSize="18sp" />
- <TextView
+ <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/account_ac"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -56,19 +56,18 @@
android:textSize="16sp" />
- </LinearLayout>
+ </androidx.appcompat.widget.LinearLayoutCompat>
- <com.google.android.material.floatingactionbutton.FloatingActionButton
+ <com.google.android.material.button.MaterialButton
android:id="@+id/account_action"
+ style="@style/Widget.Material3.Button.OutlinedButton.Icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
- android:layout_margin="5dp"
+ android:layout_marginStart="10dp"
android:contentDescription="@string/action_follow"
android:gravity="center"
- android:scaleType="fitXY"
android:visibility="gone"
- app:backgroundTint="?colorAccent"
- app:fabSize="mini" />
+ tools:visibility="visible" />
-</LinearLayout> \ No newline at end of file
+</androidx.appcompat.widget.LinearLayoutCompat> \ No newline at end of file
diff --git a/app/src/main/res/layouts/peertube/layout/drawer_channel_peertube.xml b/app/src/main/res/layouts/peertube/layout/drawer_channel_peertube.xml
index 8be2e3d60..6e1282b03 100644
--- a/app/src/main/res/layouts/peertube/layout/drawer_channel_peertube.xml
+++ b/app/src/main/res/layouts/peertube/layout/drawer_channel_peertube.xml
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License along with Fedilab; if not,
see <http://www.gnu.org/licenses>.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -22,14 +22,14 @@
android:layout_marginBottom="5dp"
android:orientation="horizontal">
- <ImageView
+ <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/account_pp"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_gravity="center_horizontal"
android:contentDescription="@string/profile_picture" />
- <LinearLayout
+ <androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/account_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
@@ -37,7 +37,7 @@
android:layout_weight="1"
android:orientation="vertical">
- <TextView
+ <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/account_dn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -45,7 +45,7 @@
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textSize="18sp" />
- <TextView
+ <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/account_ac"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -54,15 +54,15 @@
android:singleLine="true"
android:textSize="16sp" />
- </LinearLayout>
+ </androidx.appcompat.widget.LinearLayoutCompat>
- <ImageButton
+ <com.google.android.material.button.MaterialButton
android:id="@+id/more_actions"
- style="@style/Widget.AppCompat.Button.Borderless"
+ style="@style/Widget.Material3.Button.OutlinedButton.Icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center"
android:contentDescription="@string/display_more"
android:src="@drawable/ic_baseline_more_vert_24" />
-</LinearLayout> \ No newline at end of file
+</androidx.appcompat.widget.LinearLayoutCompat> \ No newline at end of file
diff --git a/app/src/main/res/layouts/peertube/layout/drawer_comment_peertube.xml b/app/src/main/res/layouts/peertube/layout/drawer_comment_peertube.xml
index 411648711..daff3e498 100644
--- a/app/src/main/res/layouts/peertube/layout/drawer_comment_peertube.xml
+++ b/app/src/main/res/layouts/peertube/layout/drawer_comment_peertube.xml
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License along with Fedilab; if not,
see <http://www.gnu.org/licenses>.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/main_container"
android:layout_width="match_parent"
@@ -25,7 +25,7 @@
android:orientation="horizontal"
android:showDividers="end">
- <LinearLayout
+ <androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/decoration_container"
android:layout_width="wrap_content"
android:layout_height="match_parent"
@@ -40,7 +40,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="10dp">
- <ImageView
+ <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/comment_account_profile"
android:layout_width="40dp"
android:layout_height="40dp"
@@ -50,7 +50,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
- <TextView
+ <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/comment_account_displayname"
android:layout_width="0dp"
android:layout_height="wrap_content"
@@ -61,7 +61,7 @@
app:layout_constraintStart_toEndOf="@+id/comment_account_profile"
app:layout_constraintTop_toTopOf="parent" />
- <TextView
+ <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/comment_account_username"
android:layout_width="0dp"
android:layout_height="wrap_content"
@@ -74,7 +74,7 @@
app:layout_constraintStart_toEndOf="@+id/comment_account_profile"
app:layout_constraintTop_toBottomOf="@+id/comment_account_displayname" />
- <TextView
+ <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/comment_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -87,7 +87,7 @@
app:layout_constraintEnd_toStartOf="@id/more_actions"
app:layout_constraintTop_toTopOf="parent" />
- <TextView
+ <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/more_actions"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -98,7 +98,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/comment_date" />
- <TextView
+ <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/comment_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
@@ -108,35 +108,34 @@
app:layout_constraintStart_toStartOf="@id/comment_account_profile"
app:layout_constraintTop_toBottomOf="@+id/comment_account_profile" />
- <TextView
+ <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/number_of_replies"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="15dp"
- android:textColor="?attr/colorAccent"
+ android:textColor="?attr/colorPrimary"
app:layout_constraintEnd_toStartOf="@+id/replyButton"
app:layout_constraintStart_toStartOf="@id/comment_account_profile"
app:layout_constraintTop_toBottomOf="@+id/comment_content" />
- <TextView
+ <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/replyButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="@string/reply"
- android:textColor="?attr/colorAccent"
+ android:textColor="?attr/colorPrimary"
app:layout_constraintStart_toEndOf="@id/number_of_replies"
app:layout_constraintTop_toTopOf="@+id/number_of_replies" />
- <Button
+ <com.google.android.material.button.MaterialButton
android:id="@+id/post_reply_button"
- style="@style/Widget.AppCompat.Button.Borderless.Colored"
+ style="@style/Widget.Material3.Button.OutlinedButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/add_public_reply"
- android:textColor="?attr/colorAccent"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -144,4 +143,4 @@
</androidx.constraintlayout.widget.ConstraintLayout>
-</LinearLayout>
+</androidx.appcompat.widget.LinearLayoutCompat>
diff --git a/app/src/main/res/layouts/peertube/layout/drawer_horizontal_account_peertube.xml b/app/src/main/res/layouts/peertube/layout/drawer_horizontal_account_peertube.xml
index 45bf25800..ab2ab6b9a 100644
--- a/app/src/main/res/layouts/peertube/layout/drawer_horizontal_account_peertube.xml
+++ b/app/src/main/res/layouts/peertube/layout/drawer_horizontal_account_peertube.xml
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License along with Fedilab; if not,
see <http://www.gnu.org/licenses>.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -23,7 +23,7 @@
android:layout_marginBottom="5dp"
android:orientation="vertical">
- <ImageView
+ <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/account_pp"
android:layout_width="40dp"
android:layout_height="40dp"
@@ -32,7 +32,7 @@
android:padding="2dp"
android:scaleType="centerCrop" />
- <TextView
+ <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/account_dn"
android:layout_width="80dp"
android:layout_height="wrap_content"
@@ -42,6 +42,6 @@
android:padding="2dp"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
- android:textColor="?colorAccent"
+ android:textColor="?colorPrimary"
android:textSize="14sp" />
-</LinearLayout> \ No newline at end of file
+</androidx.appcompat.widget.LinearLayoutCompat> \ No newline at end of file
diff --git a/app/src/main/res/layouts/peertube/layout/drawer_instance_peertube.xml b/app/src/main/res/layouts/peertube/layout/drawer_instance_peertube.xml
index ae5cefbe5..f74c84e6f 100644
--- a/app/src/main/res/layouts/peertube/layout/drawer_instance_peertube.xml
+++ b/app/src/main/res/layouts/peertube/layout/drawer_instance_peertube.xml
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License along with Fedilab; if not,
see <http://www.gnu.org/licenses>.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/main_container"
android:layout_width="match_parent"
@@ -29,7 +29,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
- <TextView
+ <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -38,7 +38,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
- <TextView
+ <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/host"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -46,7 +46,7 @@
app:layout_constraintStart_toEndOf="@+id/name"
app:layout_constraintTop_toTopOf="parent" />
- <TextView
+ <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -54,7 +54,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/name" />
- <TextView
+ <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tags"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -62,7 +62,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/description" />
- <TextView
+ <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/followers_instance"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -72,7 +72,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tags" />
- <TextView
+ <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/languages"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -82,7 +82,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/followers_instance" />
- <TextView
+ <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/sensitive_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -90,9 +90,9 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/languages" />
- <Button
+ <com.google.android.material.button.MaterialButton
android:id="@+id/pickup"
- style="@style/Base.Widget.AppCompat.Button.Colored"
+ style="@style/Widget.Material3.Button.ElevatedButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
@@ -101,4 +101,4 @@
app:layout_constraintTop_toBottomOf="@+id/sensitive_content" />
</androidx.constraintlayout.widget.ConstraintLayout>
-</LinearLayout> \ No newline at end of file
+</androidx.appcompat.widget.LinearLayoutCompat> \ No newline at end of file