Skip to content

Commit 9df64b6

Browse files
committed
"Initial commit"
1 parent 7febd60 commit 9df64b6

File tree

10 files changed

+17
-144
lines changed

10 files changed

+17
-144
lines changed

app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ dependencies {
2727
implementation 'com.android.support:appcompat-v7:27.1.1'
2828
implementation 'com.android.support:recyclerview-v7:27.1.1'
2929
implementation 'com.android.support:cardview-v7:27.1.1'
30+
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
3031
testImplementation 'junit:junit:4.12'
3132
androidTestImplementation 'com.android.support.test:runner:1.0.1'
3233
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

app/src/main/java/com/wuyr/pathlayoutmanagertest/MyView.java renamed to app/src/main/java/com/wuyr/pathlayoutmanagertest/CanvasView.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@
1414
/**
1515
* Created by wuyr on 18-5-22 下午10:32.
1616
*/
17-
public class MyView extends View {
17+
public class CanvasView extends View {
1818

19-
public MyView(Context context) {
19+
public CanvasView(Context context) {
2020
super(context);
2121
}
2222

23-
public MyView(Context context, @Nullable AttributeSet attrs) {
23+
public CanvasView(Context context, @Nullable AttributeSet attrs) {
2424
super(context, attrs);
2525
}
2626

27-
public MyView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
27+
public CanvasView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
2828
super(context, attrs, defStyleAttr);
2929
}
3030

app/src/main/java/com/wuyr/pathlayoutmanagertest/FigureOutView.java

Lines changed: 0 additions & 98 deletions
This file was deleted.

app/src/main/java/com/wuyr/pathlayoutmanagertest/MainActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
public class MainActivity extends AppCompatActivity {
2020

2121
private PathLayoutManager mPathLayoutManager;
22-
private MyView mView, mCanvasView;
22+
private CanvasView mView, mCanvasView;
2323
private MyAdapter mAdapter;
2424

2525
@Override

app/src/main/java/com/wuyr/pathlayoutmanagertest/MyAdapter.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import android.widget.Toast;
99

1010
import java.util.List;
11+
import java.util.Random;
1112

1213
/**
1314
* Created by wuyr on 18-5-20 上午4:09.
@@ -31,6 +32,7 @@ public void onBindViewHolder(ViewHolder holder, int position) {
3132
// } else {
3233
// holder.imageView.setImageResource(new Random().nextBoolean() ? R.drawable.ic_dragon_body_1 : R.drawable.ic_dragon_body_2);
3334
// }
35+
holder.imageView.setImageResource(new Random().nextBoolean() ? R.drawable.ic_j20_ : R.drawable.ic_j20);
3436
holder.rootView.setOnClickListener(v -> {
3537
toast.setText("点击了: " + holder.textView.getText().toString());
3638
toast.show();

app/src/main/res/drawable/ic_j20_.png

244 KB
Loading

app/src/main/res/layout/act_figure_out.xml

Lines changed: 0 additions & 33 deletions
This file was deleted.

app/src/main/res/layout/act_main_view.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
android:layout_width="match_parent"
44
android:layout_height="match_parent">
55

6-
<com.wuyr.pathlayoutmanagertest.MyView
6+
<com.wuyr.pathlayoutmanagertest.CanvasView
77
android:id="@+id/view"
88
android:layout_width="match_parent"
99
android:layout_height="match_parent" />
@@ -13,7 +13,7 @@
1313
android:layout_width="match_parent"
1414
android:layout_height="match_parent" />
1515

16-
<com.wuyr.pathlayoutmanagertest.MyView
16+
<com.wuyr.pathlayoutmanagertest.CanvasView
1717
android:id="@+id/canvas_view"
1818
android:layout_width="match_parent"
1919
android:layout_height="match_parent" />

app/src/main/res/layout/adapter_item_view.xml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
android:layout_width="wrap_content"
1010
android:layout_height="wrap_content"
1111
android:foreground="@drawable/background"
12+
android:visibility="invisible"
1213
app:cardBackgroundColor="@color/colorAccent"
1314
app:cardCornerRadius="4dp"
1415
app:cardElevation="4dp"
@@ -29,9 +30,9 @@
2930

3031
</android.support.v7.widget.CardView>
3132

32-
<!--<ImageView-->
33-
<!--android:layout_width="64dp"-->
34-
<!--android:layout_height="wrap_content"-->
35-
<!--android:id="@+id/image"-->
36-
<!--android:adjustViewBounds="true" />-->
33+
<ImageView
34+
android:id="@+id/image"
35+
android:layout_width="64dp"
36+
android:layout_height="wrap_content"
37+
android:adjustViewBounds="true" />
3738
</FrameLayout>

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
jcenter()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:3.1.3'
10+
classpath 'com.android.tools.build:gradle:3.1.4'
1111

1212

1313
// NOTE: Do not place your application dependencies here; they belong

0 commit comments

Comments
 (0)