mirror of
https://github.com/sifacaii/VlcJellyfin
synced 2025-05-26 06:20:20 -04:00
界面调整
This commit is contained in:
parent
7ef3d9850f
commit
1e21d0beaf
@ -14,6 +14,7 @@ import android.view.MenuItem;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.PopupMenu;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
@ -23,6 +24,8 @@ public class BaseActivity extends AppCompatActivity implements CustomAdapt {
|
|||||||
public AppCompatActivity mAA = this;
|
public AppCompatActivity mAA = this;
|
||||||
private ProgressDialog progressDialog;
|
private ProgressDialog progressDialog;
|
||||||
private ImageView activeBarBack;
|
private ImageView activeBarBack;
|
||||||
|
private ImageView actionBarSetBtn;
|
||||||
|
private PopupMenu settingMenu;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
@ -49,12 +52,30 @@ public class BaseActivity extends AppCompatActivity implements CustomAdapt {
|
|||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//actionBar设置菜单
|
||||||
|
actionBarSetBtn = findViewById(R.id.actionBar_setBtn);
|
||||||
|
actionBarSetBtn.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
settingMenu.show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
settingMenu = new PopupMenu(this,actionBarSetBtn);
|
||||||
|
settingMenu.getMenuInflater().inflate(R.menu.activebar_menu,settingMenu.getMenu());
|
||||||
|
settingMenu.setOnMenuItemClickListener(actionBarSetBtnOnclick);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void actionBarSetBtnOnclick(){
|
private PopupMenu.OnMenuItemClickListener actionBarSetBtnOnclick = new PopupMenu.OnMenuItemClickListener() {
|
||||||
|
@Override
|
||||||
}
|
public boolean onMenuItemClick(MenuItem menuItem) {
|
||||||
|
if(menuItem.getItemId() == R.id.activeBar_option_logout){
|
||||||
|
logout();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// @Override
|
// @Override
|
||||||
// public boolean onCreateOptionsMenu(@NonNull Menu menu) {
|
// public boolean onCreateOptionsMenu(@NonNull Menu menu) {
|
||||||
|
@ -10,6 +10,8 @@ public class Config {
|
|||||||
private String PassWord = "";
|
private String PassWord = "";
|
||||||
private String SortBy = "DateCreated";
|
private String SortBy = "DateCreated";
|
||||||
private String SortOrder = "Descending";
|
private String SortOrder = "Descending";
|
||||||
|
private boolean HAACC; //硬解
|
||||||
|
private boolean FORCE_HAACC; //强制硬解
|
||||||
|
|
||||||
public Config(Context context) {
|
public Config(Context context) {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
@ -61,6 +63,24 @@ public class Config {
|
|||||||
saveConfigToSP("sortorder",sortOrder);
|
saveConfigToSP("sortorder",sortOrder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isHAACC() {
|
||||||
|
return HAACC;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHAACC(boolean HAACC) {
|
||||||
|
this.HAACC = HAACC;
|
||||||
|
saveConfigToSP("HAACC",HAACC);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isFORCE_HAACC() {
|
||||||
|
return FORCE_HAACC;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFORCE_HAACC(boolean FORCE_HAACC) {
|
||||||
|
this.FORCE_HAACC = FORCE_HAACC;
|
||||||
|
saveConfigToSP("FORCE_HAACC",FORCE_HAACC);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 读取配置
|
* 读取配置
|
||||||
*/
|
*/
|
||||||
@ -71,6 +91,8 @@ public class Config {
|
|||||||
this.PassWord = sp.getString("password", "");
|
this.PassWord = sp.getString("password", "");
|
||||||
this.SortBy = sp.getString("sortby","DateCreated");
|
this.SortBy = sp.getString("sortby","DateCreated");
|
||||||
this.SortOrder = sp.getString("sortorder","Descending");
|
this.SortOrder = sp.getString("sortorder","Descending");
|
||||||
|
this.HAACC = sp.getBoolean("HAACC",true);
|
||||||
|
this.FORCE_HAACC = sp.getBoolean("FORCE_HAACC",false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -80,7 +102,16 @@ public class Config {
|
|||||||
SharedPreferences sp = context.getSharedPreferences("Jellyfin", context.MODE_PRIVATE);
|
SharedPreferences sp = context.getSharedPreferences("Jellyfin", context.MODE_PRIVATE);
|
||||||
SharedPreferences.Editor editor = sp.edit();
|
SharedPreferences.Editor editor = sp.edit();
|
||||||
editor.putString(key, value);
|
editor.putString(key, value);
|
||||||
editor.putString(key, value);
|
editor.commit();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存单项配置
|
||||||
|
*/
|
||||||
|
public void saveConfigToSP(String key, boolean value) {
|
||||||
|
SharedPreferences sp = context.getSharedPreferences("Jellyfin", context.MODE_PRIVATE);
|
||||||
|
SharedPreferences.Editor editor = sp.edit();
|
||||||
|
editor.putBoolean(key, value);
|
||||||
editor.commit();
|
editor.commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,20 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<item
|
<item
|
||||||
android:id="@+id/activeBar_option_logout"
|
android:id="@+id/actionBar_option_HAACC"
|
||||||
android:orderInCategory="1"
|
android:orderInCategory="1"
|
||||||
|
android:checkable="true"
|
||||||
|
android:title="硬解解码" />
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/actionBar_option_FORCE_HAACC"
|
||||||
|
android:orderInCategory="2"
|
||||||
|
android:checkable="false"
|
||||||
|
android:title="强制硬解解码" />
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/activeBar_option_logout"
|
||||||
|
android:orderInCategory="9"
|
||||||
android:title="注销" />
|
android:title="注销" />
|
||||||
|
|
||||||
</menu>
|
</menu>
|
@ -1,28 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
|
||||||
<item
|
|
||||||
android:id="@+id/sort_byAddDate"
|
|
||||||
android:orderInCategory="1"
|
|
||||||
android:title="加入日期" />
|
|
||||||
|
|
||||||
<item
|
|
||||||
android:id="@+id/sort_byCreateDate"
|
|
||||||
android:orderInCategory="2"
|
|
||||||
android:title="创建日期" />
|
|
||||||
|
|
||||||
<item
|
|
||||||
android:id="@+id/sort_byName"
|
|
||||||
android:orderInCategory="3"
|
|
||||||
android:title="名称" />
|
|
||||||
|
|
||||||
<item
|
|
||||||
android:id="@+id/sort_byRate"
|
|
||||||
android:orderInCategory="4"
|
|
||||||
android:title="评分" />
|
|
||||||
|
|
||||||
<item
|
|
||||||
android:id="@+id/sort_byYear"
|
|
||||||
android:orderInCategory="5"
|
|
||||||
android:title="年代"/>
|
|
||||||
</menu>
|
|
Loading…
Reference in New Issue
Block a user