mirror of
https://github.com/leanote/leanote-android.git
synced 2025-10-15 14:51:04 +00:00
add icon for notebook list’s item
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
package org.houxg.leamonax.adapter;
|
||||
|
||||
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.houxg.leamonax.R;
|
||||
@@ -91,7 +93,7 @@ public class NotebookAdapter extends RecyclerView.Adapter<NotebookAdapter.Notebo
|
||||
// boolean hasChild = hasChild(notebookId);
|
||||
holder.placeholder.setVisibility(isSuperOrRoot ? View.GONE : View.VISIBLE);
|
||||
// holder.navigator.setVisibility(hasChild ? View.VISIBLE : View.INVISIBLE);
|
||||
holder.navigator.setText(isSuper ? "-" : "+");
|
||||
holder.navigator.setImageResource(isSuper ? R.drawable.ic_expanding : R.drawable.ic_expandable);
|
||||
holder.navigator.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -175,9 +177,10 @@ public class NotebookAdapter extends RecyclerView.Adapter<NotebookAdapter.Notebo
|
||||
static class NotebookHolder extends RecyclerView.ViewHolder {
|
||||
View itemView;
|
||||
@BindView(R.id.navigator)
|
||||
TextView navigator;
|
||||
ImageView navigator;
|
||||
@BindView(R.id.tv_title)
|
||||
TextView titleTv;
|
||||
@Nullable
|
||||
@BindView(R.id.placeholder)
|
||||
View placeholder;
|
||||
|
||||
|
BIN
app/src/main/res/drawable-xxhdpi/ic_add_note_book.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/ic_add_note_book.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_expandable.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/ic_expandable.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 446 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_expanding.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/ic_expanding.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 499 B |
@@ -2,34 +2,30 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<View
|
||||
android:id="@+id/placeholder"
|
||||
android:layout_width="12dp"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
<ImageView
|
||||
android:id="@+id/navigator"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center"
|
||||
android:text="+"
|
||||
android:textColor="#333"
|
||||
android:textSize="18sp" />
|
||||
android:layout_gravity="start|center_vertical"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingStart="16dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_add_note_book" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_vertical|start"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:paddingBottom="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingTop="8dp"
|
||||
android:text="@string/add_notebook"
|
||||
android:textColor="@color/primary_text_light"
|
||||
android:textSize="16sp" />
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
@@ -1,37 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:clickable="true"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<View
|
||||
android:id="@+id/placeholder"
|
||||
android:layout_width="12dp"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
<ImageView
|
||||
android:id="@+id/navigator"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center"
|
||||
android:text="+"
|
||||
android:textColor="#333"
|
||||
android:textSize="18sp" />
|
||||
android:layout_gravity="start|center_vertical"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingStart="16dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_expandable" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_gravity="start|center_vertical"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:gravity="center_vertical|start"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:gravity="start|center_vertical"
|
||||
android:paddingBottom="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingTop="8dp"
|
||||
tools:text="NotebookTitle"
|
||||
android:textColor="@color/primary_text_light"
|
||||
android:textSize="16sp" />
|
||||
android:textSize="14sp"
|
||||
tools:text="NotebookTitle" />
|
||||
|
||||
</LinearLayout>
|
Reference in New Issue
Block a user