-
Notifications
You must be signed in to change notification settings - Fork 863
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 1073ca1
Showing
156 changed files
with
7,465 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/workspace.xml | ||
/.idea/libraries | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
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,34 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion 26 | ||
defaultConfig { | ||
applicationId "com.bin.david.smarttable" | ||
minSdkVersion 15 | ||
targetSdkVersion 26 | ||
versionCode 1 | ||
versionName "1.0" | ||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation fileTree(include: ['*.jar'], dir: 'libs') | ||
implementation 'com.android.support:appcompat-v7:26.1.0' | ||
implementation 'com.android.support.constraint:constraint-layout:1.0.2' | ||
testImplementation 'junit:junit:4.12' | ||
androidTestImplementation 'com.android.support.test:runner:1.0.1' | ||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' | ||
implementation project(':form') | ||
compile 'com.zhy:okhttputils:2.6.2' | ||
compile 'com.google.code.gson:gson:2.8.0' | ||
compile 'com.android.support:recyclerview-v7:25.3.1' | ||
compile 'com.github.huangyanbin:SmartChart:1.3.2' | ||
compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.31' | ||
} |
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,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
26 changes: 26 additions & 0 deletions
26
app/src/androidTest/java/com/bin/david/smarttable/ExampleInstrumentedTest.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,26 @@ | ||
package com.bin.david.smarttable; | ||
|
||
import android.content.Context; | ||
import android.support.test.InstrumentationRegistry; | ||
import android.support.test.runner.AndroidJUnit4; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a> | ||
*/ | ||
@RunWith(AndroidJUnit4.class) | ||
public class ExampleInstrumentedTest { | ||
@Test | ||
public void useAppContext() throws Exception { | ||
// Context of the app under test. | ||
Context appContext = InstrumentationRegistry.getTargetContext(); | ||
|
||
assertEquals("com.bin.david.smarttable", appContext.getPackageName()); | ||
} | ||
} |
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,26 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.bin.david.smarttable"> | ||
|
||
<uses-permission android:name="android.permission.INTERNET"/> | ||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> | ||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme"> | ||
<activity android:name=".MainActivity"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
<activity android:name=".AnnotationModeActivity"/> | ||
<activity android:name=".NetHttpActivity"/> | ||
<activity android:name=".ParseModeActivity"/> | ||
</application> | ||
|
||
</manifest> |
37 changes: 37 additions & 0 deletions
37
app/src/main/java/com/bin/david/smarttable/AnnotationModeActivity.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,37 @@ | ||
package com.bin.david.smarttable; | ||
|
||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.view.View; | ||
|
||
import com.bin.david.form.core.SmartTable; | ||
import com.bin.david.form.data.style.FontStyle; | ||
import com.bin.david.form.utils.DensityUtils; | ||
import com.bin.david.smarttable.bean.ChildData; | ||
import com.bin.david.smarttable.bean.UserData; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class AnnotationModeActivity extends AppCompatActivity { | ||
|
||
private SmartTable<UserData> table; | ||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_table); | ||
FontStyle.setDefaultTextSize(DensityUtils.sp2px(this,15)); | ||
table = findViewById(R.id.table); | ||
List<UserData> testData = new ArrayList<>(); | ||
for(int i = 0;i <100; i++) { | ||
testData.add(new UserData("huang", 18, System.currentTimeMillis(),true,new ChildData("测试1"))); | ||
testData.add(new UserData("li", 23, System.currentTimeMillis(),false,null)); | ||
} | ||
table.setData(testData); | ||
} | ||
public void onClick(View view) { | ||
Intent intent = new Intent(this,ParseModeActivity.class); | ||
startActivity(intent); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
app/src/main/java/com/bin/david/smarttable/BaseApplication.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,30 @@ | ||
package com.bin.david.smarttable; | ||
|
||
import android.app.Application; | ||
|
||
import com.zhy.http.okhttp.OkHttpUtils; | ||
|
||
import java.util.concurrent.TimeUnit; | ||
|
||
import okhttp3.OkHttpClient; | ||
|
||
/** | ||
* Created by huang on 2017/11/4. | ||
*/ | ||
|
||
public class BaseApplication extends Application { | ||
|
||
@Override | ||
public void onCreate() { | ||
super.onCreate(); | ||
OkHttpClient okHttpClient = new OkHttpClient.Builder() | ||
// .addInterceptor(new LoggerInterceptor("TAG")) | ||
.connectTimeout(10000L, TimeUnit.MILLISECONDS) | ||
.readTimeout(10000L, TimeUnit.MILLISECONDS) | ||
//其他配置 | ||
.build(); | ||
|
||
OkHttpUtils.initClient(okHttpClient); | ||
|
||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
app/src/main/java/com/bin/david/smarttable/MainActivity.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,44 @@ | ||
package com.bin.david.smarttable; | ||
|
||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.support.v7.widget.LinearLayoutManager; | ||
import android.support.v7.widget.RecyclerView; | ||
import android.view.View; | ||
|
||
import com.bin.david.smarttable.adapter.ItemAdapter; | ||
import com.bin.david.smarttable.bean.MainItem; | ||
import com.chad.library.adapter.base.BaseQuickAdapter; | ||
|
||
import java.util.ArrayList; | ||
|
||
public class MainActivity extends AppCompatActivity { | ||
private RecyclerView recyclerView; | ||
private ItemAdapter itemAdapter; | ||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_main); | ||
recyclerView = (RecyclerView) findViewById(R.id.recyclerView); | ||
recyclerView.setLayoutManager(new LinearLayoutManager(this)); | ||
ArrayList<MainItem> items = new ArrayList<>(); | ||
items.add(new MainItem(ParseModeActivity.class,"解析模式")); | ||
items.add(new MainItem(AnnotationModeActivity.class,"注解模式")); | ||
items.add(new MainItem(NetHttpActivity.class,"网络模式")); | ||
itemAdapter = new ItemAdapter(items); | ||
recyclerView.setAdapter(itemAdapter); | ||
itemAdapter.openLoadAnimation(); | ||
itemAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() { | ||
@Override | ||
public void onItemClick(BaseQuickAdapter adapter, View view, int position) { | ||
MainItem mainItem = (MainItem) adapter.getData().get(position); | ||
Intent i = new Intent(MainActivity.this,mainItem.clazz); | ||
startActivity(i); | ||
} | ||
}); | ||
} | ||
|
||
|
||
|
||
} |
Oops, something went wrong.