我正在使用浮动操作按钮.我想在按FAB按钮时单击"禁用Recyclerview项目".我试过这种方法但没有工作setClickable(true);
我的布局
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:fab="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="#fff"
tools:context="com.hartwintech.socialchat.activity.IconTabsActivity">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:scrollbars="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
>
</android.support.v7.widget.RecyclerView>
<com.github.clans.fab.FloatingActionMenu
android:id="@+id/floatmenu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="60dp"
android:layout_marginRight="16dp"
fab:fab_showAnimation="@anim/show_from_bottom"
fab:fab_hideAnimation="@anim/hide_to_bottom"
fab:menu_labels_style="@style/MenuLabelsStyle"
fab:menu_shadowColor="#444"
fab:menu_colorNormal="#FFB805"
fab:menu_colorPressed="#F2AB00"
fab:menu_colorRipple="#D99200"/>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
Java类
floatMenu.setOnMenuToggleListener(new FloatingActionMenu.OnMenuToggleListener() {
@Override
public void onMenuToggle(boolean opened) {
if (opened) {
final int color = R.color.transp;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
mrecyclerview.setClickable(false);
mrecyclerview.setEnabled(false);
mrecyclerview.setForeground(new ColorDrawable(ContextCompat.getColor(getContext(), color)));
}
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
mrecyclerview.setClickable(true);
mrecyclerview.setEnabled(true);
mrecyclerview.setForeground(null);
}
}
}
});
Run Code Online (Sandbox Code Playgroud) 如何删除该字符串中的第一行和最后一行
String key = "-----BEGIN PUBLIC KEY-----\n" +
"MIGeMA0GCSqGSIb3DQEBAQUAA4GMADCBiAKBgE0JOa5WUcifbDnnQWB2WKOOODwq\n" +
"JUxu/7fG2BaynwVRSifljrzGjqpS24R0ss3cZZSKfD2GszG0aVd5T1Yvh4kSOzsx\n" +
"arj8QUkfW/EL5ClhDv8LVtkErbTU42QLUUTl5izyKZXaHFdBnJZ8jqXk4AlK22mp\n" +
"LcMadrpv7SzQJq1HAgMBAAE=\n" +
"-----END PUBLIC KEY-----";
Run Code Online (Sandbox Code Playgroud)
我想要一个像这样的输出字符串
String key ="MIGeMA0GCSqGSIb3DQEBAQUAA4GMADCBiAKBgE0JOa5WUcifbDnnQWB2WKOOODwq
JUxu/7fG2BaynwVRSifljrzGjqpS24R0ss3cZZSKfD2GszG0aVd5T1Yvh4kSOzsx
arj8QUkfW/EL5ClhDv8LVtkErbTU42QLUUTl5izyKZXaHFdBnJZ8jqXk4AlK22mp
LcMadrpv7SzQJq1HAgMBAAE="
Run Code Online (Sandbox Code Playgroud)