mirror of
https://framagit.org/tom79/fedilab-tube
synced 2025-06-05 21:09:11 +02:00
Some fixes
This commit is contained in:
parent
9d599e8b57
commit
8cc8b284ce
@ -8,6 +8,6 @@
|
|||||||
<color name="tag_color_text">#FAFAFA</color>
|
<color name="tag_color_text">#FAFAFA</color>
|
||||||
<color name="positive_thumbs">#2b90d9</color>
|
<color name="positive_thumbs">#2b90d9</color>
|
||||||
<color name="negative_thumbs">#F44336</color>
|
<color name="negative_thumbs">#F44336</color>
|
||||||
|
<color name="backgroundDark">#DD000000</color>
|
||||||
<color name="red_1">#F44336</color>
|
<color name="red_1">#F44336</color>
|
||||||
</resources>
|
</resources>
|
@ -28,6 +28,7 @@ import android.content.pm.PackageManager;
|
|||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.database.sqlite.SQLiteDatabase;
|
import android.database.sqlite.SQLiteDatabase;
|
||||||
import android.graphics.PorterDuff;
|
import android.graphics.PorterDuff;
|
||||||
|
import android.graphics.Rect;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
@ -40,6 +41,7 @@ import android.text.Spanned;
|
|||||||
import android.util.DisplayMetrics;
|
import android.util.DisplayMetrics;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.view.animation.Animation;
|
import android.view.animation.Animation;
|
||||||
@ -180,6 +182,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
private videoOrientation videoOrientationType;
|
private videoOrientation videoOrientationType;
|
||||||
private int initialOrientation;
|
private int initialOrientation;
|
||||||
private String currentResolution;
|
private String currentResolution;
|
||||||
|
private String currentCaption;
|
||||||
|
|
||||||
public static void hideKeyboard(Activity activity) {
|
public static void hideKeyboard(Activity activity) {
|
||||||
if (activity != null && activity.getWindow() != null) {
|
if (activity != null && activity.getWindow() != null) {
|
||||||
@ -538,6 +541,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
}
|
}
|
||||||
currentResolution = null;
|
currentResolution = null;
|
||||||
show_more_content = null;
|
show_more_content = null;
|
||||||
|
currentCaption = "null";
|
||||||
binding.peertubeDescriptionMore.setVisibility(View.GONE);
|
binding.peertubeDescriptionMore.setVisibility(View.GONE);
|
||||||
if (autoFullscreen && autoPlay) {
|
if (autoFullscreen && autoPlay) {
|
||||||
openFullscreenDialog();
|
openFullscreenDialog();
|
||||||
@ -1633,6 +1637,27 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean dispatchTouchEvent(MotionEvent event) {
|
||||||
|
|
||||||
|
if (MotionEvent.ACTION_UP == event.getAction()) {
|
||||||
|
Rect viewRectParams = new Rect();
|
||||||
|
binding.videoParams.getGlobalVisibleRect(viewRectParams);
|
||||||
|
if (binding.videoParams.getVisibility() == View.VISIBLE && !viewRectParams.contains((int) event.getRawX(), (int) event.getRawY())) {
|
||||||
|
closeMainMenuOptions();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
Rect viewRectParamsSub = new Rect();
|
||||||
|
binding.videoParamsSubmenu.getGlobalVisibleRect(viewRectParamsSub);
|
||||||
|
if (binding.videoParamsSubmenu.getVisibility() == View.VISIBLE && !viewRectParamsSub.contains((int) event.getRawX(), (int) event.getRawY())) {
|
||||||
|
closeSubMenuMenuOptions();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return super.dispatchTouchEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
private void updateHistory(long position) {
|
private void updateHistory(long position) {
|
||||||
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
||||||
boolean storeInHistory = sharedpreferences.getBoolean(getString(R.string.set_store_in_history), true);
|
boolean storeInHistory = sharedpreferences.getBoolean(getString(R.string.set_store_in_history), true);
|
||||||
@ -1720,21 +1745,19 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
case CAPTION:
|
case CAPTION:
|
||||||
binding.subMenuTitle.setText(R.string.pickup_captions);
|
binding.subMenuTitle.setText(R.string.pickup_captions);
|
||||||
items = new ArrayList<>();
|
items = new ArrayList<>();
|
||||||
items.add(new MenuItemView(-1, "null", getString(R.string.none)));
|
items.add(new MenuItemView(-1, "null", getString(R.string.none), currentCaption.compareTo("null") == 0));
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (Caption caption : captions) {
|
for (Caption caption : captions) {
|
||||||
items.add(new MenuItemView(i, caption.getLanguage().getId(), caption.getLanguage().getLabel()));
|
items.add(new MenuItemView(i, caption.getLanguage().getId(), caption.getLanguage().getLabel(), currentCaption.compareTo(caption.getLanguage().getId()) == 0));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (items != null) {
|
|
||||||
MenuItemAdapter menuItemAdapter = new MenuItemAdapter(action, items);
|
MenuItemAdapter menuItemAdapter = new MenuItemAdapter(action, items);
|
||||||
menuItemAdapter.itemAction = this;
|
menuItemAdapter.itemAction = this;
|
||||||
binding.subMenuRecycler.setAdapter(menuItemAdapter);
|
binding.subMenuRecycler.setAdapter(menuItemAdapter);
|
||||||
binding.subMenuRecycler.setLayoutManager(new LinearLayoutManager(PeertubeActivity.this));
|
binding.subMenuRecycler.setLayoutManager(new LinearLayoutManager(PeertubeActivity.this));
|
||||||
openSubMenuMenuOptions();
|
openSubMenuMenuOptions();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void which(MenuItemVideo.actionType action, MenuItemView item) {
|
public void which(MenuItemVideo.actionType action, MenuItemView item) {
|
||||||
@ -1778,6 +1801,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
uri = Uri.parse("https://" + peertubeInstance + captions.get(item.getId()).getCaptionPath());
|
uri = Uri.parse("https://" + peertubeInstance + captions.get(item.getId()).getCaptionPath());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
currentCaption = item.getStrId();
|
||||||
long newPosition = player.getCurrentPosition();
|
long newPosition = player.getCurrentPosition();
|
||||||
|
|
||||||
if (player != null)
|
if (player != null)
|
||||||
|
@ -50,11 +50,11 @@ public class MenuItemView {
|
|||||||
this.selected = false;
|
this.selected = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MenuItemView(int id, String strId, String label) {
|
public MenuItemView(int id, String strId, String label, boolean selected) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.strId = strId;
|
this.strId = strId;
|
||||||
this.label = label;
|
this.label = label;
|
||||||
this.selected = false;
|
this.selected = selected;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user