Skip to content

Commit

Permalink
* add
Browse files Browse the repository at this point in the history
  * 增加library
  • Loading branch information
andjdk committed Oct 17, 2016
1 parent 84b89c8 commit 64184e3
Show file tree
Hide file tree
Showing 12 changed files with 118 additions and 16 deletions.
1 change: 1 addition & 0 deletions hvscrollviewlibrary/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
31 changes: 31 additions & 0 deletions hvscrollviewlibrary/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 24
buildToolsVersion "23.0.3"

defaultConfig {
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.0.0'
testCompile 'junit:junit:4.12'
}
17 changes: 17 additions & 0 deletions hvscrollviewlibrary/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in D:\android\SDK\sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# 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 *;
#}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.andjdk.hvscrollviewlibrary;

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.*;

/**
* Instrumentation 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.andjdk.hvscrollviewlibrary.test", appContext.getPackageName());
}
}
9 changes: 9 additions & 0 deletions hvscrollviewlibrary/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.andjdk.hvscrollviewlibrary">

<application android:allowBackup="true" android:label="@string/app_name"
android:supportsRtl="true">

</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@
* # 佛祖保佑 永无BUG #
* # #
*/
package com.andjdk.hvscrollview.base;

import java.util.ArrayList;
import java.util.List;
package com.andjdk.hvscrollviewlibrary;

import android.content.Context;
import android.view.LayoutInflater;
Expand All @@ -36,7 +33,8 @@
import android.widget.BaseAdapter;
import android.widget.LinearLayout;

import com.andjdk.hvscrollview.R;
import java.util.ArrayList;
import java.util.List;

/**
* listview通用的adapter类
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* # 佛祖保佑 永无BUG #
* # #
*/
package com.andjdk.hvscrollview.utils;
package com.andjdk.hvscrollviewlibrary;

import android.content.Context;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* # 佛祖保佑 永无BUG #
* # #
*/
package com.andjdk.hvscrollview.view;
package com.andjdk.hvscrollviewlibrary;

import android.content.Context;
import android.util.AttributeSet;
Expand All @@ -37,14 +37,10 @@
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.andjdk.hvscrollview.base.CommonAdapter;
import com.andjdk.hvscrollview.utils.DisplayUtil;

import java.util.ArrayList;

import static com.andjdk.hvscrollview.utils.DisplayUtil.dip2px;
import static com.andjdk.hvscrollviewlibrary.DisplayUtil.dip2px;

/**
* Created by andjdk on 2015/11/3.
Expand Down Expand Up @@ -96,7 +92,7 @@ private void initView() {
linearLayout.addView(buildHeadLayout());
linearLayout.addView(buildMoveableListView());

this.addView(linearLayout, new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,
this.addView(linearLayout, new LayoutParams(LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT));
}

Expand Down Expand Up @@ -292,9 +288,9 @@ public void setHeaderListData(String[] headerListData) {
this.mMovableListColumnsText = headerListData;
mMovableListColumnsWidth = new int[headerListData.length];
for (int i = 0; i < headerListData.length; i++) {
mMovableListColumnsWidth[i] = DisplayUtil.dip2px(context, mMoveViewWidth);
mMovableListColumnsWidth[i] = dip2px(context, mMoveViewWidth);
}
mFixLeftListColumnsWidth = new int[]{DisplayUtil.dip2px(context, mFixViewWidth)};
mFixLeftListColumnsWidth = new int[]{dip2px(context, mFixViewWidth)};
mFixLeftListColumnsText = new String[]{"名称"};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* # 佛祖保佑 永无BUG #
* # #
*/
package com.andjdk.hvscrollview.base;
package com.andjdk.hvscrollviewlibrary;

import android.content.Context;
import android.graphics.Bitmap;
Expand Down
4 changes: 4 additions & 0 deletions hvscrollviewlibrary/src/main/res/values/ids.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<item type="id" name="move_layout" />
</resources>
3 changes: 3 additions & 0 deletions hvscrollviewlibrary/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<string name="app_name">HVScrollViewLibrary</string>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.andjdk.hvscrollviewlibrary;

import org.junit.Test;

import static org.junit.Assert.*;

/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}

0 comments on commit 64184e3

Please sign in to comment.