fix: crash on notification events
This commit is contained in:
@@ -125,7 +125,8 @@ public class MyScriptListFragment extends ViewPagerFragment implements BackPress
|
||||
@Override
|
||||
public void onDetach() {
|
||||
super.onDetach();
|
||||
mFloatingActionMenu.setOnFloatingActionButtonClickListener(null);
|
||||
if (mFloatingActionMenu != null)
|
||||
mFloatingActionMenu.setOnFloatingActionButtonClickListener(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,6 +11,7 @@ import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.PopupMenu;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -316,6 +317,9 @@ public class ScriptListView extends SwipeRefreshLayout implements SwipeRefreshLa
|
||||
@BindView(R.id.title)
|
||||
TextView mTitle;
|
||||
|
||||
@BindView(R.id.sort)
|
||||
ImageView mSort;
|
||||
|
||||
CategoryViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
ButterKnife.bind(this, itemView);
|
||||
@@ -326,5 +330,17 @@ public class ScriptListView extends SwipeRefreshLayout implements SwipeRefreshLa
|
||||
mTitle.setText(isDirCategory ? R.string.text_directory : R.string.text_file);
|
||||
}
|
||||
|
||||
@OnClick(R.id.order)
|
||||
void changeSortOrder() {
|
||||
|
||||
}
|
||||
|
||||
@OnClick(R.id.sort)
|
||||
void showSortOptions() {
|
||||
PopupMenu popupMenu = new PopupMenu(getContext(), mSort);
|
||||
popupMenu.inflate(R.menu.menu_sort_options);
|
||||
popupMenu.setOnMenuItemClickListener(ScriptListView.this);
|
||||
popupMenu.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/order"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
@@ -45,6 +46,7 @@
|
||||
android:tint="#828384"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/sort"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
|
||||
19
app/src/main/res/menu/menu_sort_options.xml
Normal file
19
app/src/main/res/menu/menu_sort_options.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:checkable="true"
|
||||
android:title="@string/text_name"/>
|
||||
<item
|
||||
android:checkable="true"
|
||||
android:title="@string/text_time"
|
||||
/>
|
||||
<item
|
||||
android:checkable="true"
|
||||
android:title="@string/text_size"
|
||||
/>
|
||||
<item
|
||||
android:checkable="true"
|
||||
android:title="@string/text_type"
|
||||
/>
|
||||
</menu>
|
||||
@@ -249,6 +249,9 @@
|
||||
<string name="text_forgot_password">忘记密码</string>
|
||||
<string name="text_username_cannot_be_empty">用户名不能为空</string>
|
||||
<string name="text_password_cannot_be_empty">密码不能为空</string>
|
||||
<string name="text_time">时间</string>
|
||||
<string name="text_size">大小</string>
|
||||
<string name="text_type">类型</string>
|
||||
|
||||
|
||||
<string-array name="record_control_keys">
|
||||
|
||||
Reference in New Issue
Block a user