https://code.google.com/p/im-only-resting/
http://www.swensensoftware.com/im-only-resting
https://github.com/wiztools/rest-client
RecyclerView step 3
step1
public class xxxxxxxx extends RecyclerView.Adapter<MyAdapter.ViewHolder> implements View.OnClickListener {
step2
public void onBindViewHolder(RecyclerView.ViewHolder viewHolder, int position
viewHolder.textView.setOnClickListener(this);
textView is findViewById(R.id.xxxxxxxxx)
step3
@Override
public void onClick(View view) {
int viewId = view.getId();
if (viewId == R.id.xxxxxxxxx) { //which item click
if (onItemClickListener != null) {
onItemClickListener.onItemClick(view, (Integer) view.getTag());
}
}
}
view.getTag() maybe null
https://developer.android.com/training/material/lists-cards.html
I think many people, try to do this demo. But this demo is not good, because some things no show.
like:
RecyclerView .xml to a layout:…….only little, but ok, this not import.
MyAdapter .xml no layout: this is bad. Get error in here.
so, follow this do is better
http://stackoverflow.com/questions/28407768/android-widget-linearlayout-cannot-be-cast-to-android-widget-textview-in-recycle
Gorcyn is good guy~~ ^ ^
But what different with android demo (fxxxxxxxxxxxxxx)
android:
public ViewHolder(TextView v) { mTextView = v; good guy:
change build.gradle
use old couchbase.lite then ok compile ‘com.couchbase.lite:couchbase-lite-android:1.1.0-516’
use 1.3.0
1.4.0 but get error, some method go away~
http://xxx.xxx.xxx.xx:4985/admin/
click Documents
click left documents, then show data on top. then can see two button
“Save Doc” “Revert DOC”
Now you can change data in { …………….. }
Changed finish, click “Save Doc”, now document be change.
I think sync to app right now.
https://www.youtube.com/watch?v=hzeeENTRjlc
https://www.youtube.com/watch?v=3Zl7bJXqYJU
6:10 start demo
======
……….don’t show import.
這問題是因為模擬器版本的問題,改build.gradle
dependencies {
compile ‘com.couchbase.lite:couchbase-lite-android:x.x.x’
}
要變更版本x.x.x.x部份,找版本
http://files.couchbase.com/maven2/com/couchbase/lite/couchbase-lite-android/