-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from AlanCheen/ann
Support Android Annotation Processor COOL!!!
- Loading branch information
Showing
34 changed files
with
486 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 2 additions & 10 deletions
12
...va/me/yifeiyuan/flapdev/BaseFlapItem.java → .../yifeiyuan/flapdev/base/BaseFlapItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package me.yifeiyuan.flapdev.base; | ||
|
||
/** | ||
* Created by 程序亦非猿 on 2019/1/29. | ||
*/ | ||
public class BaseModel { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
app/src/main/java/me/yifeiyuan/flapdev/generictest/GenericFlapItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package me.yifeiyuan.flapdev.generictest; | ||
|
||
import android.support.annotation.NonNull; | ||
import android.view.View; | ||
|
||
import java.util.List; | ||
|
||
import me.yifeiyuan.flap.FlapAdapter; | ||
import me.yifeiyuan.flap.annotations.Flap; | ||
import me.yifeiyuan.flapdev.R; | ||
import me.yifeiyuan.flapdev.base.BaseFlapItem; | ||
|
||
/** | ||
* Created by 程序亦非猿 on 2019/1/29. | ||
*/ | ||
|
||
@Flap(layoutId = R.layout.flap_item_generic_type) | ||
public class GenericFlapItem extends BaseFlapItem<GenericModel> { | ||
|
||
public GenericFlapItem(final View itemView) { | ||
super(itemView); | ||
} | ||
|
||
@Override | ||
protected void onBind(@NonNull final GenericModel model, @NonNull final FlapAdapter adapter, @NonNull final List<Object> payloads) { | ||
|
||
} | ||
|
||
// public static class Factory extends LayoutItemFactory<GenericModel, GenericFlapItem> { | ||
// @Override | ||
// protected int getLayoutResId(final GenericModel model) { | ||
// return R.layout.flap_item_generic_type; | ||
// } | ||
// } | ||
|
||
} |
9 changes: 9 additions & 0 deletions
9
app/src/main/java/me/yifeiyuan/flapdev/generictest/GenericModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package me.yifeiyuan.flapdev.generictest; | ||
|
||
import me.yifeiyuan.flapdev.base.BaseModel; | ||
|
||
/** | ||
* Created by 程序亦非猿 on 2019/1/29. | ||
*/ | ||
public class GenericModel extends BaseModel { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
app/src/main/java/me/yifeiyuan/flapdev/testann/AnnItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package me.yifeiyuan.flapdev.testann; | ||
|
||
import android.support.annotation.NonNull; | ||
import android.util.Log; | ||
import android.view.View; | ||
|
||
import java.util.List; | ||
|
||
import me.yifeiyuan.flap.FlapAdapter; | ||
import me.yifeiyuan.flap.FlapItem; | ||
import me.yifeiyuan.flap.annotations.Flap; | ||
import me.yifeiyuan.flapdev.R; | ||
|
||
/** | ||
* Created by 程序亦非猿 on 2019-03-22. | ||
*/ | ||
|
||
@Flap(layoutId = R.layout.flap_item_ann) | ||
public class AnnItem extends FlapItem<AnnModel> { | ||
|
||
private static final String TAG = "SimpleTextItem"; | ||
|
||
public AnnItem(final View itemView) { | ||
super(itemView); | ||
} | ||
|
||
@Override | ||
protected void onBind(@NonNull final AnnModel model, @NonNull final FlapAdapter adapter, @NonNull final List<Object> payloads) { | ||
Log.d(TAG, "onBind: " + getAdapterPosition()); | ||
} | ||
|
||
// public static class Factory extends LayoutItemFactory<AnnModel, AnnItem> { | ||
// | ||
// @Override | ||
// protected int getLayoutResId(final AnnModel model) { | ||
// return R.layout.flap_item_simple_text; | ||
// } | ||
// | ||
// } | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package me.yifeiyuan.flapdev.testann; | ||
|
||
import me.yifeiyuan.flapdev.base.BaseModel; | ||
|
||
/** | ||
* Created by 程序亦非猿 on 2019-03-22. | ||
*/ | ||
public class AnnModel extends BaseModel { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<FrameLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="48dp"> | ||
|
||
<TextView | ||
android:id="@+id/tv_" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:textColor="@android:color/black" | ||
android:textSize="16sp" | ||
android:singleLine="true" | ||
android:gravity="center" | ||
android:text="Android Annotation Processor" | ||
/> | ||
</FrameLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<FrameLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="48dp" | ||
android:background="@android:color/holo_green_dark"> | ||
|
||
<TextView | ||
android:id="@+id/tv_" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:gravity="center" | ||
android:singleLine="true" | ||
android:text="Generic Type" | ||
android:textColor="@android:color/white" | ||
android:textSize="16sp" | ||
/> | ||
|
||
</FrameLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
Oops, something went wrong.