Replaced more icon with fonts

This commit is contained in:
Stefan Schueller 2018-12-29 22:36:54 +01:00
parent d3ce980acc
commit 3f93ccfc92
13 changed files with 49 additions and 34 deletions

View File

@ -6,8 +6,8 @@ android {
applicationId "net.schueller.peertube" applicationId "net.schueller.peertube"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 28 targetSdkVersion 28
versionCode 1016 versionCode 1017
versionName "1.0.16" versionName "1.0.17"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
dependencies { dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.jar'])

View File

@ -286,8 +286,8 @@ public class VideoPlayActivity extends AppCompatActivity implements VideoRendere
TextView videoOwner = findViewById(R.id.videoOwner); TextView videoOwner = findViewById(R.id.videoOwner);
TextView videoMeta = findViewById(R.id.videoMeta); TextView videoMeta = findViewById(R.id.videoMeta);
ImageView avatarView = findViewById(R.id.avatar); ImageView avatarView = findViewById(R.id.avatar);
ImageButton moreButton = findViewById(R.id.moreButton); TextView moreButton = findViewById(R.id.moreButton);
ImageButton videoOptions = findViewById(R.id.exo_more); TextView videoOptions = findViewById(R.id.exo_more);
Video video = response.body(); Video video = response.body();
@ -320,6 +320,9 @@ public class VideoPlayActivity extends AppCompatActivity implements VideoRendere
); );
videoDescription.setText(video.getDescription()); videoDescription.setText(video.getDescription());
moreButton.setText(R.string.video_more_icon);
new Iconics.IconicsBuilder().ctx(context).on(moreButton).build();
moreButton.setOnClickListener(v -> { moreButton.setOnClickListener(v -> {
PopupMenu popup = new PopupMenu(context, v); PopupMenu popup = new PopupMenu(context, v);
popup.setOnMenuItemClickListener(menuItem -> { popup.setOnMenuItemClickListener(menuItem -> {
@ -336,6 +339,9 @@ public class VideoPlayActivity extends AppCompatActivity implements VideoRendere
}); });
// video player options // video player options
videoOptions.setText(R.string.video_more_icon);
new Iconics.IconicsBuilder().ctx(context).on(videoOptions).build();
videoOptions.setOnClickListener(v -> { videoOptions.setOnClickListener(v -> {
VideoOptionsFragment videoOptionsFragment = VideoOptionsFragment videoOptionsFragment =

View File

@ -22,6 +22,8 @@ import android.content.Intent;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.appcompat.widget.PopupMenu; import androidx.appcompat.widget.PopupMenu;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.content.pm.ActivityInfo;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -29,6 +31,7 @@ import android.widget.ImageButton;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import com.mikepenz.iconics.Iconics;
import com.squareup.picasso.Picasso; import com.squareup.picasso.Picasso;
import net.schueller.peertube.R; import net.schueller.peertube.R;
@ -111,6 +114,9 @@ public class VideoAdapter extends RecyclerView.Adapter<VideoAdapter.VideoViewHol
}); });
holder.moreButton.setText(R.string.video_more_icon);
new Iconics.IconicsBuilder().ctx(context).on(holder.moreButton).build();
holder.moreButton.setOnClickListener(v -> { holder.moreButton.setOnClickListener(v -> {
PopupMenu popup = new PopupMenu(context, v); PopupMenu popup = new PopupMenu(context, v);
@ -147,9 +153,8 @@ public class VideoAdapter extends RecyclerView.Adapter<VideoAdapter.VideoViewHol
class VideoViewHolder extends RecyclerView.ViewHolder { class VideoViewHolder extends RecyclerView.ViewHolder {
TextView name, videoMeta, videoOwner; TextView name, videoMeta, videoOwner, moreButton;
ImageView thumb, avatar; ImageView thumb, avatar;
ImageButton moreButton;
View mView; View mView;
VideoViewHolder(View itemView) { VideoViewHolder(View itemView) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 565 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 693 B

View File

@ -86,16 +86,19 @@
android:textAppearance="@style/Base.TextAppearance.AppCompat.Caption" android:textAppearance="@style/Base.TextAppearance.AppCompat.Caption"
/> />
<ImageButton <TextView
android:id="@+id/moreButton" android:id="@+id/moreButton"
android:layout_width="wrap_content" android:layout_width="45dp"
android:layout_height="45dp" android:layout_height="45dp"
android:layout_below="@+id/thumb"
android:layout_marginTop="16dp"
android:layout_marginStart="-16dp" android:layout_marginStart="-16dp"
android:layout_marginEnd="0dp" android:layout_marginEnd="0dp"
android:layout_toEndOf="@+id/name" android:layout_toEndOf="@+id/name"
android:background="@null" android:background="@null"
android:contentDescription="@string/descr_overflow_button" android:contentDescription="@string/descr_overflow_button"
android:src="@drawable/ic_action_more_vert" /> android:textAppearance="@style/Base.TextAppearance.AppCompat.Caption"
/>
<TextView <TextView
android:id="@+id/description" android:id="@+id/description"

View File

@ -72,20 +72,19 @@
android:textAppearance="@style/Base.TextAppearance.AppCompat.Caption" android:textAppearance="@style/Base.TextAppearance.AppCompat.Caption"
/> />
<ImageButton <TextView
android:id="@+id/moreButton" android:id="@+id/moreButton"
android:layout_width="wrap_content" android:layout_width="45dp"
android:layout_height="45dp" android:layout_height="45dp"
android:layout_below="@+id/thumb" android:layout_below="@+id/thumb"
android:layout_marginTop="16dp"
android:layout_marginStart="-16dp" android:layout_marginStart="-16dp"
android:layout_marginEnd="0dp" android:layout_marginEnd="0dp"
android:layout_toEndOf="@+id/name" android:layout_toEndOf="@+id/name"
android:background="@null" android:background="@null"
android:contentDescription="@string/descr_overflow_button" android:contentDescription="@string/descr_overflow_button"
android:src="@drawable/ic_action_more_vert" /> android:textAppearance="@style/Base.TextAppearance.AppCompat.Caption"
/>
</RelativeLayout> </RelativeLayout>

View File

@ -10,28 +10,27 @@
android:orientation="vertical" android:orientation="vertical"
tools:targetApi="28"> tools:targetApi="28">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="0dp"
android:gravity="bottom"
android:orientation="horizontal">
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
<ImageButton <FrameLayout
android:id="@+id/exo_more_button"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_gravity="end">
<TextView
android:id="@+id/exo_more" android:id="@+id/exo_more"
android:layout_width="wrap_content" android:layout_width="18dp"
android:layout_height="48dp" android:layout_height="wrap_content"
android:background="@null" android:layout_gravity="end"
android:paddingTop="0dp" android:paddingTop="12dp"
android:src="@drawable/ic_action_more_vert" android:adjustViewBounds="true"
android:tint="#ffffff" /> android:scaleType="fitCenter"
android:textColor="#FFBEBEBE"
android:textSize="12sp" />
</FrameLayout>
</LinearLayout>
<View <View

View File

@ -9,12 +9,14 @@
android:orderInCategory="300" android:orderInCategory="300"
android:title="@string/action_bar_title_search" android:title="@string/action_bar_title_search"
app:showAsAction="always|collapseActionView" app:showAsAction="always|collapseActionView"
android:textAppearance="@style/Base.TextAppearance.AppCompat.Caption"
app:actionViewClass="androidx.appcompat.widget.SearchView" /> app:actionViewClass="androidx.appcompat.widget.SearchView" />
<item <item
android:id="@+id/action_settings" android:id="@+id/action_settings"
android:orderInCategory="300" android:orderInCategory="300"
android:title="@string/action_bar_title_settings" android:title="@string/action_bar_title_settings"
android:textAppearance="@style/Base.TextAppearance.AppCompat.Caption"
app:showAsAction="ifRoom" /> app:showAsAction="ifRoom" />
</menu> </menu>

View File

@ -93,6 +93,7 @@
<string name="video_speed_active_icon">{faw-check}</string> <string name="video_speed_active_icon">{faw-check}</string>
<string name="video_expand_icon">{faw-expand}</string> <string name="video_expand_icon">{faw-expand}</string>
<string name="video_compress_icon">{faw-compress}</string> <string name="video_compress_icon">{faw-compress}</string>
<string name="video_more_icon">{faw-ellipsis-v}</string>
<string name="pref_title_background_play">Background Playback</string> <string name="pref_title_background_play">Background Playback</string>
<string name="pref_description_background_play">If enabled, continues to play video in background.</string> <string name="pref_description_background_play">If enabled, continues to play video in background.</string>
<string name="bottom_nav_title_local">Local</string> <string name="bottom_nav_title_local">Local</string>