fixed behaviour, layout and style fix, renamed method, added comment
This commit is contained in:
parent
14c78bd5bc
commit
149edf5000
@ -62,12 +62,12 @@
|
||||
<activity
|
||||
android:name=".activity.TweetEditor"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Transparency" />
|
||||
android:theme="@style/TransparencyDim" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.MessageEditor"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Transparency" />
|
||||
android:theme="@style/TransparencyDim" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.AppSettings"
|
||||
@ -118,7 +118,7 @@
|
||||
<activity
|
||||
android:name=".activity.ListEditor"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Transparency" />
|
||||
android:theme="@style/TransparencyDim" />
|
||||
|
||||
</application>
|
||||
|
||||
|
@ -36,15 +36,14 @@ import org.nuclearfog.twidda.backend.engine.EngineException;
|
||||
import org.nuclearfog.twidda.backend.holder.ImageHolder;
|
||||
import org.nuclearfog.twidda.backend.utils.AppStyles;
|
||||
import org.nuclearfog.twidda.backend.utils.ErrorHandler;
|
||||
import org.nuclearfog.twidda.backend.utils.StringTools;
|
||||
import org.nuclearfog.twidda.database.GlobalSettings;
|
||||
import org.nuclearfog.zoomview.ZoomView;
|
||||
|
||||
import java.text.NumberFormat;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static android.graphics.PorterDuff.Mode.SRC_IN;
|
||||
import static android.media.MediaPlayer.MEDIA_ERROR_UNKNOWN;
|
||||
import static android.media.MediaPlayer.MEDIA_INFO_BUFFERING_END;
|
||||
import static android.media.MediaPlayer.MEDIA_INFO_BUFFERING_START;
|
||||
@ -97,10 +96,15 @@ public class MediaViewer extends MediaActivity implements OnImageClickListener,
|
||||
*/
|
||||
public static final int MEDIAVIEWER_ANGIF = 4;
|
||||
|
||||
private static final int PROGRESS_DELAY = 500;
|
||||
private static final int SPEED_FACTOR = 6;
|
||||
/**
|
||||
* refresh time for video progress update
|
||||
*/
|
||||
private static final int PROGRESS_UPDATE = 1000;
|
||||
|
||||
private static final NumberFormat formatter = NumberFormat.getIntegerInstance();
|
||||
/**
|
||||
* speed factor for fast forward or backward
|
||||
*/
|
||||
private static final int SPEED_FACTOR = 6;
|
||||
|
||||
private enum PlayStat {
|
||||
PLAY,
|
||||
@ -115,7 +119,7 @@ public class MediaViewer extends MediaActivity implements OnImageClickListener,
|
||||
private TextView duration, position;
|
||||
private ProgressBar loadingCircle;
|
||||
private SeekBar video_progress;
|
||||
private ImageButton playPause;
|
||||
private ImageButton play, pause;
|
||||
private ImageAdapter adapter;
|
||||
private VideoView videoView;
|
||||
private ZoomView zoomImage;
|
||||
@ -138,29 +142,24 @@ public class MediaViewer extends MediaActivity implements OnImageClickListener,
|
||||
zoomImage = findViewById(R.id.image_full);
|
||||
videoView = findViewById(R.id.video_view);
|
||||
video_progress = controlPanel.findViewById(R.id.controller_progress);
|
||||
playPause = controlPanel.findViewById(R.id.controller_playpause);
|
||||
play = controlPanel.findViewById(R.id.controller_play);
|
||||
pause = controlPanel.findViewById(R.id.controller_pause);
|
||||
duration = controlPanel.findViewById(R.id.controller_duration);
|
||||
position = controlPanel.findViewById(R.id.controller_position);
|
||||
ImageButton forward = controlPanel.findViewById(R.id.controller_forward);
|
||||
ImageButton backward = controlPanel.findViewById(R.id.controller_backward);
|
||||
ImageButton share = controlPanel.findViewById(R.id.controller_share);
|
||||
|
||||
videoView.setZOrderOnTop(true);
|
||||
GlobalSettings settings = GlobalSettings.getInstance(this);
|
||||
adapter = new ImageAdapter(settings, this);
|
||||
share.setImageResource(R.drawable.share);
|
||||
forward.setImageResource(R.drawable.forward);
|
||||
backward.setImageResource(R.drawable.backward);
|
||||
playPause.setImageResource(R.drawable.pause);
|
||||
play.setImageResource(R.drawable.play);
|
||||
pause.setImageResource(R.drawable.pause);
|
||||
AppStyles.setProgressColor(loadingCircle, settings.getHighlightColor());
|
||||
controlPanel.setBackgroundColor(settings.getCardColor());
|
||||
AppStyles.setSeekBarColor(settings, video_progress);
|
||||
share.setColorFilter(settings.getIconColor(), SRC_IN);
|
||||
forward.setColorFilter(settings.getIconColor(), SRC_IN);
|
||||
backward.setColorFilter(settings.getIconColor(), SRC_IN);
|
||||
playPause.setColorFilter(settings.getIconColor(), SRC_IN);
|
||||
duration.setTextColor(settings.getFontColor());
|
||||
position.setTextColor(settings.getFontColor());
|
||||
AppStyles.setTheme(settings, controlPanel);
|
||||
|
||||
// get intent data and type
|
||||
mediaLinks = getIntent().getStringArrayExtra(KEY_MEDIA_LINK);
|
||||
@ -193,7 +192,7 @@ public class MediaViewer extends MediaActivity implements OnImageClickListener,
|
||||
}
|
||||
});
|
||||
}
|
||||
}, PROGRESS_DELAY, PROGRESS_DELAY, TimeUnit.MILLISECONDS);
|
||||
}, PROGRESS_UPDATE, PROGRESS_UPDATE, TimeUnit.MILLISECONDS);
|
||||
case MEDIAVIEWER_ANGIF:
|
||||
zoomImage.setVisibility(GONE);
|
||||
Uri video = Uri.parse(mediaLinks[0]);
|
||||
@ -202,7 +201,8 @@ public class MediaViewer extends MediaActivity implements OnImageClickListener,
|
||||
}
|
||||
}
|
||||
share.setOnClickListener(this);
|
||||
playPause.setOnClickListener(this);
|
||||
play.setOnClickListener(this);
|
||||
pause.setOnClickListener(this);
|
||||
videoView.setOnTouchListener(this);
|
||||
backward.setOnTouchListener(this);
|
||||
forward.setOnTouchListener(this);
|
||||
@ -234,18 +234,24 @@ public class MediaViewer extends MediaActivity implements OnImageClickListener,
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// play/pause video
|
||||
if (v.getId() == R.id.controller_playpause) {
|
||||
if (videoView.isPlaying()) {
|
||||
videoView.pause();
|
||||
playPause.setImageResource(R.drawable.play);
|
||||
playStat = PlayStat.PAUSE;
|
||||
} else {
|
||||
// play video
|
||||
if (v.getId() == R.id.controller_play) {
|
||||
if (!videoView.isPlaying()) {
|
||||
play.setVisibility(INVISIBLE);
|
||||
pause.setVisibility(VISIBLE);
|
||||
videoView.resume();
|
||||
playPause.setImageResource(R.drawable.pause);
|
||||
playStat = PlayStat.PLAY;
|
||||
}
|
||||
}
|
||||
// pause video
|
||||
if (v.getId() == R.id.controller_pause) {
|
||||
if (videoView.isPlaying()) {
|
||||
pause.setVisibility(INVISIBLE);
|
||||
play.setVisibility(VISIBLE);
|
||||
videoView.pause();
|
||||
playStat = PlayStat.PAUSE;
|
||||
}
|
||||
}
|
||||
// open link with another app
|
||||
else if (v.getId() == R.id.controller_share) {
|
||||
if (mediaLinks != null && mediaLinks.length > 0) {
|
||||
@ -259,6 +265,7 @@ public class MediaViewer extends MediaActivity implements OnImageClickListener,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onTouch(View v, MotionEvent event) {
|
||||
if (v.getId() == R.id.controller_backward) {
|
||||
@ -322,11 +329,11 @@ public class MediaViewer extends MediaActivity implements OnImageClickListener,
|
||||
} else {
|
||||
playStat = PlayStat.PLAY;
|
||||
video_progress.setMax(mp.getDuration());
|
||||
duration.setText(formatter.format(mp.getDuration()));
|
||||
duration.setText(StringTools.formatMediaTime(mp.getDuration()));
|
||||
if (videoPos > 0) {
|
||||
mp.seekTo(videoPos);
|
||||
}
|
||||
position.setText(formatter.format(mp.getCurrentPosition()));
|
||||
position.setText(StringTools.formatMediaTime(mp.getCurrentPosition()));
|
||||
mp.setOnSeekCompleteListener(this);
|
||||
}
|
||||
mp.setOnInfoListener(this);
|
||||
@ -365,9 +372,8 @@ public class MediaViewer extends MediaActivity implements OnImageClickListener,
|
||||
|
||||
@Override
|
||||
public void onSeekComplete(MediaPlayer mp) {
|
||||
position.setText(formatter.format(mp.getCurrentPosition()));
|
||||
position.setText(StringTools.formatMediaTime(mp.getCurrentPosition()));
|
||||
if (playStat == PlayStat.PLAY) {
|
||||
playPause.setImageResource(R.drawable.pause);
|
||||
mp.start();
|
||||
}
|
||||
}
|
||||
@ -375,7 +381,8 @@ public class MediaViewer extends MediaActivity implements OnImageClickListener,
|
||||
|
||||
@Override
|
||||
public void onCompletion(MediaPlayer mp) {
|
||||
playPause.setImageResource(R.drawable.play);
|
||||
pause.setVisibility(INVISIBLE);
|
||||
play.setVisibility(VISIBLE);
|
||||
playStat = PlayStat.PAUSE;
|
||||
videoPos = 0;
|
||||
}
|
||||
@ -383,6 +390,7 @@ public class MediaViewer extends MediaActivity implements OnImageClickListener,
|
||||
|
||||
@Override
|
||||
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
||||
position.setText(StringTools.formatMediaTime(progress));
|
||||
}
|
||||
|
||||
|
||||
@ -437,11 +445,10 @@ public class MediaViewer extends MediaActivity implements OnImageClickListener,
|
||||
case PLAY:
|
||||
video_progress.setProgress(videoPos);
|
||||
videoPos = videoView.getCurrentPosition();
|
||||
position.setText(formatter.format(videoPos));
|
||||
break;
|
||||
|
||||
case FORWARD:
|
||||
videoPos += 2 * PROGRESS_DELAY * SPEED_FACTOR;
|
||||
videoPos += 2 * PROGRESS_UPDATE * SPEED_FACTOR;
|
||||
if (videoPos > videoView.getDuration())
|
||||
videoPos = videoView.getDuration();
|
||||
videoView.pause();
|
||||
@ -449,7 +456,7 @@ public class MediaViewer extends MediaActivity implements OnImageClickListener,
|
||||
break;
|
||||
|
||||
case BACKWARD:
|
||||
videoPos -= 2 * PROGRESS_DELAY * SPEED_FACTOR;
|
||||
videoPos -= 2 * PROGRESS_UPDATE * SPEED_FACTOR;
|
||||
if (videoPos < 0)
|
||||
videoPos = 0;
|
||||
videoView.pause();
|
||||
|
@ -29,7 +29,7 @@ import static android.view.View.GONE;
|
||||
import static android.view.View.INVISIBLE;
|
||||
import static android.view.View.VISIBLE;
|
||||
import static androidx.recyclerview.widget.RecyclerView.NO_POSITION;
|
||||
import static org.nuclearfog.twidda.backend.utils.StringTools.getTimeString;
|
||||
import static org.nuclearfog.twidda.backend.utils.StringTools.formatCreationTime;
|
||||
|
||||
/**
|
||||
* Adapter class for user lists
|
||||
@ -204,7 +204,7 @@ public class ListAdapter extends Adapter<ViewHolder> {
|
||||
vh.textViews[1].setText(item.getDescription());
|
||||
vh.textViews[2].setText(owner.getUsername());
|
||||
vh.textViews[3].setText(owner.getScreenname());
|
||||
vh.textViews[4].setText(getTimeString(item.getCreatedAt()));
|
||||
vh.textViews[4].setText(formatCreationTime(item.getCreatedAt()));
|
||||
vh.textViews[5].setText(formatter.format(item.getMemberCount()));
|
||||
vh.textViews[6].setText(formatter.format(item.getSubscriberCount()));
|
||||
if (settings.getImageLoad() && owner.hasProfileImage()) {
|
||||
|
@ -28,7 +28,7 @@ import static android.view.View.GONE;
|
||||
import static android.view.View.INVISIBLE;
|
||||
import static android.view.View.VISIBLE;
|
||||
import static androidx.recyclerview.widget.RecyclerView.NO_POSITION;
|
||||
import static org.nuclearfog.twidda.backend.utils.StringTools.getTimeString;
|
||||
import static org.nuclearfog.twidda.backend.utils.StringTools.formatCreationTime;
|
||||
|
||||
/**
|
||||
* Adapter class for direct messages list
|
||||
@ -195,7 +195,7 @@ public class MessageAdapter extends Adapter<ViewHolder> {
|
||||
holder.textViews[0].setText(sender.getUsername());
|
||||
holder.textViews[1].setText(sender.getScreenname());
|
||||
holder.textViews[2].setText(message.getReceiver().getScreenname());
|
||||
holder.textViews[3].setText(getTimeString(message.getTime()));
|
||||
holder.textViews[3].setText(formatCreationTime(message.getTime()));
|
||||
holder.textViews[4].setText(text);
|
||||
if (sender.isVerified()) {
|
||||
holder.verifiedIcon.setVisibility(VISIBLE);
|
||||
|
@ -34,7 +34,7 @@ import static android.view.View.INVISIBLE;
|
||||
import static android.view.View.VISIBLE;
|
||||
import static androidx.recyclerview.widget.RecyclerView.NO_ID;
|
||||
import static androidx.recyclerview.widget.RecyclerView.NO_POSITION;
|
||||
import static org.nuclearfog.twidda.backend.utils.StringTools.getTimeString;
|
||||
import static org.nuclearfog.twidda.backend.utils.StringTools.formatCreationTime;
|
||||
|
||||
/**
|
||||
* Adapter class for tweet list
|
||||
@ -275,7 +275,7 @@ public class TweetAdapter extends Adapter<ViewHolder> {
|
||||
tweetItem.textViews[1].setText(user.getScreenname());
|
||||
tweetItem.textViews[3].setText(formatter.format(tweet.getRetweetCount()));
|
||||
tweetItem.textViews[4].setText(formatter.format(tweet.getFavoriteCount()));
|
||||
tweetItem.textViews[6].setText(getTimeString(tweet.getTime()));
|
||||
tweetItem.textViews[6].setText(formatCreationTime(tweet.getTime()));
|
||||
|
||||
if (tweet.retweeted()) {
|
||||
tweetItem.rtIcon.setColorFilter(Color.GREEN, SRC_IN);
|
||||
|
@ -19,7 +19,7 @@ public final class StringTools {
|
||||
* @param time time value from which to create a difference
|
||||
* @return time string showing the time difference
|
||||
*/
|
||||
public static String getTimeString(long time) {
|
||||
public static String formatCreationTime(long time) {
|
||||
long diff = new Date().getTime() - time;
|
||||
long seconds = diff / 1000;
|
||||
long minutes = seconds / 60;
|
||||
@ -49,7 +49,29 @@ public final class StringTools {
|
||||
}
|
||||
|
||||
/**
|
||||
* count @usernames in a string
|
||||
* format media time to string
|
||||
*
|
||||
* @param time duration/current position in ms
|
||||
* @return time string
|
||||
*/
|
||||
public static String formatMediaTime(int time) {
|
||||
String result = "";
|
||||
int seconds = (time / 1000) % 60;
|
||||
int minutes = (time / 60000) % 60;
|
||||
|
||||
if (minutes < 10)
|
||||
result += "0";
|
||||
result += minutes + ":";
|
||||
|
||||
if (seconds < 10)
|
||||
result += "0";
|
||||
result += seconds;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* count @username mentions in a string
|
||||
*
|
||||
* @param text text
|
||||
* @return username count
|
||||
@ -59,7 +81,7 @@ public final class StringTools {
|
||||
for (int i = 0; i < text.length() - 1; i++) {
|
||||
if (text.charAt(i) == '@') {
|
||||
char next = text.charAt(i + 1);
|
||||
if ((next >= 'a' && next <= 'z') || (next >= 'A' && next <= 'Z') || (next >= '0' && next <= '9')) {
|
||||
if ((next >= 'a' && next <= 'z') || (next >= 'A' && next <= 'Z') || (next >= '0' && next <= '9') || next == '_') {
|
||||
result++;
|
||||
}
|
||||
}
|
||||
|
@ -2,18 +2,19 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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:background="@color/half_transparent">
|
||||
|
||||
<org.nuclearfog.zoomview.ZoomView
|
||||
android:id="@+id/image_full"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:visibility="invisible"
|
||||
app:enable_move="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:enable_move="true"
|
||||
app:max_zoom_in="10.0"
|
||||
app:max_zoom_out="0.7" />
|
||||
|
||||
@ -26,19 +27,19 @@
|
||||
android:layout_marginBottom="@dimen/mediapage_preview_margin"
|
||||
android:scrollbars="horizontal"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintHeight_percent="0.2"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
app:layout_constraintHeight_percent="0.2" />
|
||||
|
||||
<VideoView
|
||||
android:id="@+id/video_view"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/media_progress"
|
||||
@ -46,9 +47,9 @@
|
||||
android:layout_height="@dimen/mediapage_circle_size"
|
||||
android:layout_marginTop="@dimen/mediapage_preview_margin"
|
||||
app:layout_constraintBottom_toTopOf="@+id/image_list"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<include
|
||||
android:id="@+id/media_controlpanel"
|
||||
@ -57,8 +58,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/mediapage_controller_bottom_margin"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -6,63 +6,81 @@
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/controller_backward"
|
||||
android:layout_width="@dimen/controller_button_size"
|
||||
android:layout_height="@dimen/controller_button_size"
|
||||
android:layout_width="@dimen/controller_button_width"
|
||||
android:layout_height="@dimen/controller_button_height"
|
||||
android:layout_marginTop="@dimen/controller_seekbar_margin"
|
||||
android:contentDescription="@string/button_backward"
|
||||
app:layout_constraintEnd_toStartOf="@id/controller_playpause"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/controller_play"
|
||||
style="@style/RoundButton" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/controller_playpause"
|
||||
android:layout_width="@dimen/controller_button_size"
|
||||
android:layout_height="@dimen/controller_button_size"
|
||||
android:id="@+id/controller_play"
|
||||
style="@style/RoundButton"
|
||||
android:layout_width="@dimen/controller_button_width"
|
||||
android:layout_height="@dimen/controller_button_height"
|
||||
android:layout_marginTop="@dimen/controller_seekbar_margin"
|
||||
android:contentDescription="@string/button_play_pause"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintEnd_toStartOf="@id/controller_forward"
|
||||
app:layout_constraintStart_toEndOf="@id/controller_backward"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/controller_pause"
|
||||
style="@style/RoundButton"
|
||||
android:layout_width="@dimen/controller_button_width"
|
||||
android:layout_height="@dimen/controller_button_height"
|
||||
android:contentDescription="@string/button_play_pause"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintStart_toStartOf="@+id/controller_play"
|
||||
app:layout_constraintTop_toTopOf="@+id/controller_play"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/controller_play"
|
||||
app:layout_constraintEnd_toEndOf="@+id/controller_play" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/controller_forward"
|
||||
android:layout_width="@dimen/controller_button_size"
|
||||
android:layout_height="@dimen/controller_button_size"
|
||||
android:layout_width="@dimen/controller_button_width"
|
||||
android:layout_height="@dimen/controller_button_height"
|
||||
android:layout_marginTop="@dimen/controller_seekbar_margin"
|
||||
android:contentDescription="@string/button_forward"
|
||||
app:layout_constraintStart_toEndOf="@id/controller_play"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/controller_share"
|
||||
app:layout_constraintStart_toEndOf="@id/controller_playpause"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
style="@style/RoundButton" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/controller_share"
|
||||
android:layout_width="@dimen/controller_button_size"
|
||||
android:layout_height="@dimen/controller_button_size"
|
||||
android:layout_width="@dimen/controller_button_width"
|
||||
android:layout_height="@dimen/controller_button_height"
|
||||
android:layout_marginTop="@dimen/controller_seekbar_margin"
|
||||
android:contentDescription="@string/button_share"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/controller_forward"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
style="@style/RoundButton" />
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/controller_barrier"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:barrierDirection="bottom"
|
||||
app:constraint_referenced_ids="controller_backward,controller_forward,controller_playpause" />
|
||||
app:constraint_referenced_ids="controller_backward,controller_forward,controller_play" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/controller_position"
|
||||
android:layout_width="@dimen/controller_text_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:layout_marginStart="@dimen/controller_text_margin"
|
||||
android:layout_marginLeft="@dimen/controller_text_margin"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/controller_barrier"
|
||||
android:singleLine="true"
|
||||
android:textSize="@dimen/controller_text_size"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/controller_progress" />
|
||||
app:layout_constraintEnd_toStartOf="@id/controller_progress"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/controller_barrier" />
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/controller_progress"
|
||||
@ -79,12 +97,13 @@
|
||||
android:id="@+id/controller_duration"
|
||||
android:layout_width="@dimen/controller_text_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:layout_marginRight="@dimen/controller_text_margin"
|
||||
android:layout_marginEnd="@dimen/controller_text_margin"
|
||||
app:layout_constraintStart_toEndOf="@id/controller_progress"
|
||||
app:layout_constraintTop_toBottomOf="@id/controller_barrier"
|
||||
android:layout_marginRight="@dimen/controller_text_margin"
|
||||
android:singleLine="true"
|
||||
android:textSize="@dimen/controller_text_size"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/controller_progress"
|
||||
app:layout_constraintTop_toBottomOf="@id/controller_barrier" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -195,7 +195,9 @@
|
||||
<!--dimens of controlpanel-->
|
||||
<dimen name="controller_seekbar_margin">10dp</dimen>
|
||||
<dimen name="controller_text_margin">5dp</dimen>
|
||||
<dimen name="controller_button_size">48dp</dimen>
|
||||
<dimen name="controller_text_size">12sp</dimen>
|
||||
<dimen name="controller_button_width">64dp</dimen>
|
||||
<dimen name="controller_button_height">32dp</dimen>
|
||||
<dimen name="controller_text_width">60sp</dimen>
|
||||
|
||||
</resources>
|
@ -12,6 +12,9 @@
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:colorBackground">@android:color/transparent</item>
|
||||
</style>
|
||||
|
||||
<style name="TransparencyDim" parent="Transparency">
|
||||
<item name="android:backgroundDimEnabled">true</item>
|
||||
</style>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user