mirror of
https://github.com/sifacaii/VlcJellyfin
synced 2025-05-26 06:20:20 -04:00
优化
This commit is contained in:
parent
c81ac71bc1
commit
72f042c944
@ -16,6 +16,7 @@
|
||||
android:roundIcon="@drawable/touchicon144"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/jellyfin"
|
||||
android:usesCleartextTraffic="true"
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
|
@ -3,11 +3,13 @@ package org.sifacai.vlcjellyfin;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.PopupWindow;
|
||||
import android.widget.ScrollView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -25,7 +27,8 @@ public class PopMenu extends PopupWindow {
|
||||
private Context context;
|
||||
private ArrayList<menu> items;
|
||||
private View attView;
|
||||
private LinearLayout contentView;
|
||||
private ScrollView contentView;
|
||||
private LinearLayout itemContiner;
|
||||
|
||||
public PopMenu(Context context, View attView) {
|
||||
super(context);
|
||||
@ -37,9 +40,11 @@ public class PopMenu extends PopupWindow {
|
||||
setOutsideTouchable(true);
|
||||
setFocusable(true);
|
||||
setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
contentView = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.popmenu,null);
|
||||
contentView = (ScrollView) LayoutInflater.from(context).inflate(R.layout.popmenu,null);
|
||||
setContentView(contentView);
|
||||
itemContiner = contentView.findViewById(R.id.popitemContiner);
|
||||
this.attView = attView;
|
||||
setClippingEnabled(true);
|
||||
}
|
||||
|
||||
public menu add(int groupid,int id,int orderid,String name){
|
||||
@ -52,11 +57,14 @@ public class PopMenu extends PopupWindow {
|
||||
m.v = v;
|
||||
((TextView)v).setText(name);
|
||||
items.add(m);
|
||||
contentView.addView(v);
|
||||
itemContiner.addView(v);
|
||||
return m;
|
||||
}
|
||||
|
||||
public void show(){
|
||||
if(items.size() > 12){
|
||||
setHeight(500);
|
||||
}
|
||||
contentView.measure(makeDropDownMeasureSpec(getWidth())
|
||||
,makeDropDownMeasureSpec(getHeight()));
|
||||
int offx = 0;
|
||||
@ -66,7 +74,9 @@ public class PopMenu extends PopupWindow {
|
||||
|
||||
public void show(int index){
|
||||
show();
|
||||
items.get(index).v.requestFocus();
|
||||
if(index >=0 && index < items.size()) {
|
||||
items.get(index).v.requestFocus();
|
||||
}
|
||||
}
|
||||
|
||||
public void show(String name){
|
||||
|
@ -1,8 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="0dp"
|
||||
android:layout_margin="0dp" >
|
||||
</LinearLayout>
|
||||
android:layout_margin="0dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/popitemContiner"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="0dp"
|
||||
android:orientation="vertical"
|
||||
android:padding="0dp" />
|
||||
|
||||
</ScrollView>
|
@ -1,10 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="jellyfin" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<style name="jellyfin" parent="Theme.Material3.Dark.NoActionBar">
|
||||
<!-- hide title bar -->
|
||||
<item name="windowNoTitle">true</item>
|
||||
<item name="android:background">@null</item>
|
||||
<item name="android:windowBackground">@drawable/app_bg</item>
|
||||
<!-- <item name="windowNoTitle">true</item>-->
|
||||
<!-- <item name="android:background">@null</item>-->
|
||||
<!-- <item name="android:windowBackground">@drawable/app_bg</item>-->
|
||||
|
||||
<item name="android:textSize">22dp</item>
|
||||
<!-- 默认 Button,TextView的文字颜色 -->
|
||||
@ -14,7 +14,7 @@
|
||||
<!-- RadioButton checkbox等控件的文字 -->
|
||||
<item name="android:textColorPrimaryDisableOnly">#1C71A9</item>
|
||||
<!-- 应用的主要文字颜色,actionBar的标题文字默认使用该颜色 -->
|
||||
<item name="android:textColorPrimary">#FFFFFF</item>
|
||||
<item name="android:textColorPrimary">@android:color/white</item>
|
||||
<!-- 辅助的文字颜色,一般比textColorPrimary的颜色弱一点,用于一些弱化的表示 -->
|
||||
<item name="android:textColorSecondary">#C1C1C1</item>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user