我想创建Material DesignedAndroid应用程序,我尝试遵循谷歌关于为新版本制作精美版面的所有建议RecylcerView.在RecyclerView有头像ImageView,标题和副标题TextView和操作图标ImageView.
我应该在ImageView的适当位置放置什么值width,height因此它支持不同的屏幕尺寸和密度,我应该从系统图标包中选择那些可绘制的尺寸?
列表建议:
??? 在xml代码中是未知的东西我不知道放在那里:
XML:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view_friend"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
card_view:cardCornerRadius="4dp"
card_view:cardUseCompatPadding="true">
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">???
<ImageView
android:id="@+id/friend_profile_picture"
android:layout_width="40dp"???
android:layout_height="40dp"???
android:layout_alignParentLeft="true"
android:layout_margin="16dp"
android:layout_centerVertical="true"
android:src="@drawable/ic_person_grey600_48dp"/>???
<TextView
android:id="@+id/friend_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/friend_online_imageview"
android:layout_toRightOf="@+id/friend_profile_picture"
android:paddingTop="20dp"
android:text="@string/plain_text_for_preview"
android:textSize="16sp"/>
<TextView
android:id="@+id/friend_state"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/friend_name"
android:layout_toLeftOf="@id/friend_online_imageview"
android:layout_toRightOf="@+id/friend_profile_picture"
android:paddingBottom="20dp"
android:text="@string/plain_text_for_preview"
android:textSize="14sp"/>
<ImageView
android:id="@+id/friend_online_imageview"
android:layout_width="wrap_content"???
android:layout_height="wrap_content"???
android:layout_alignParentRight="true"
android:layout_margin="16dp"
android:layout_centerVertical="true"
android:src="@drawable/ic_messenger_grey600_18dp"/>???
</RelativeLayout>
</android.support.v7.widget.CardView>
Run Code Online (Sandbox Code Playgroud)
预习:

android android-drawable material-design android-recyclerview
我需要在我的Android应用程序中实现搜索功能,它使用工具栏,SlidingTabLayout和保存片段的ViewPager.在每个片段中都有一个包含项目列表的RecyclerView.
RecyclerView数据是在单独的类(DataAccess.java)中静态定义的,这些列表会更新,只需通过调用(不传递新数据)即可刷新RecyclerView
mRecyclerView.getAdapter().notifyDataSetChanged();
Run Code Online (Sandbox Code Playgroud)
有没有简单的方法临时过滤RecyclerView而不更改数据,并在用户按下工具栏内的返回按钮后删除过滤器并显示初始列表.
在按工具栏菜单中的搜索图标之前:

因此,当用户输入"Josip ..."时,过滤器将处于活动状态

在他按下SearchView中的X按钮后,用户将获得与之前相同的数据而不使用过滤器.
@Override
public boolean onQueryTextChange(String newText) {
// filter data (temporary remove all items from DataAccess.list that don't .startsWith(newText)
}
@Override
public boolean onQueryTextSubmit(String query)
// Doesn't help if I revert deleted items here
}
Run Code Online (Sandbox Code Playgroud) android-fragments searchview android-toolbar android-recyclerview
我创建了android应用程序并在google play上托管它,但突然我在Eclipse中删除了我的项目(也从磁盘中删除),现在我从备份中恢复了一些文件,但我没有旧app_id的res/values/strings.xml
我如何app_id从播放服务或.apk或密钥库获取,因为我需要它Google API integration
<meta-data android:name="com.google.android.gms.games.APP_ID"
android:value="@string/app_id" />
Run Code Online (Sandbox Code Playgroud) 我下载了mpj-v0_44并将其提取到C:\mpj
把Windows系统环境。变量MPJ_HOME来C:\mpj在PATH增值C:\mpj\bin
我说mpi.jar,mpj.jar在项目结构- >库
并编写了简单的helloworld mpi程序:
import mpi.MPI;
public class Main {
public static void main(String[] args) {
MPI.Init(args);
int me = MPI.COMM_WORLD.Rank();
int size = MPI.COMM_WORLD.Size();
System.out.println("Hello world from <"+me+"> from <"+size);
MPI.Finalize();
}
}
Run Code Online (Sandbox Code Playgroud)
但是我收到以下错误:
MPJ Express (0.44) is started in the multicore configuration
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at runtime.starter.MulticoreStarter$1.run(MulticoreStarter.java:281)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: 0
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at …Run Code Online (Sandbox Code Playgroud)