Skip to content

Commit

Permalink
决定还是提交Library,维护太麻烦了
Browse files Browse the repository at this point in the history
  • Loading branch information
dan.wang committed Sep 14, 2016
1 parent 7fa0af7 commit a6cc4f2
Show file tree
Hide file tree
Showing 209 changed files with 33,092 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
.DS_Store
/build
/.idea
/library

/searchview
/captures
/dashboard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import android.text.TextUtils;
import android.util.TypedValue;
import android.view.MenuItem;
import android.view.SubMenu;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
Expand All @@ -42,6 +43,8 @@
import org.aisen.android.common.utils.ViewUtils;
import org.aisen.android.component.bitmaploader.BitmapLoader;
import org.aisen.android.component.bitmaploader.core.BitmapDecoder;
import org.aisen.android.component.cardmenu.CardMenuBuilder;
import org.aisen.android.component.cardmenu.CardMenuOptions;
import org.aisen.android.network.task.TaskException;
import org.aisen.android.network.task.WorkTask;
import org.aisen.android.ui.activity.basic.BaseActivity;
Expand Down Expand Up @@ -222,11 +225,33 @@ public static File getUploadFile(Context context, File source) {
return file;
}

public static void showMenuDialog(ABaseFragment fragment, final View targetView,
public static void showMenuDialog(final ABaseFragment fragment, final View targetView,
String[] menuArr, DialogInterface.OnClickListener onItemClickListener) {
new AlertDialogWrapper.Builder(fragment.getActivity())
.setItems(menuArr, onItemClickListener)
.show();
CardMenuOptions options = new CardMenuOptions(android.support.v7.appcompat.R.style.Theme_AppCompat_Light_NoActionBar,
android.support.v7.appcompat.R.attr.actionOverflowMenuStyle,
android.support.v7.appcompat.R.layout.abc_action_menu_layout,
android.support.v7.appcompat.R.layout.abc_action_menu_item_layout);
CardMenuBuilder builder = new CardMenuBuilder(fragment.getActivity(),
targetView,
options);
SubMenu subMenu = builder.addSubMenu(1, 100, 1, "嘿嘿");
String[] items = new String[]{ "嘿嘿1", "嘿嘿2" };
for (int i = 0; i < items.length; i++) {
builder.addSubMenuItem(subMenu, 100, i, i, items[i]);
}
builder.setOnCardMenuCallback(new CardMenuBuilder.OnCardMenuCallback() {

@Override
public boolean onCardMenuItemSelected(MenuItem menuItem) {
ViewUtils.showMessage(fragment.getActivity(), menuItem.getTitle() + "");
return true;
}

});
builder.show();
// new AlertDialogWrapper.Builder(fragment.getActivity())
// .setItems(menuArr, onItemClickListener)
// .show();
}

public static String getFirstId(@SuppressWarnings("rawtypes") List datas) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.aisen.weibo.sina.ui.fragment.hot;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
Expand Down Expand Up @@ -125,7 +124,7 @@ class TopicsHotItemView extends ARecycleViewItemView<WebHotTopicsBean> {

private ImageConfig config;

public TopicsHotItemView(Context context, View itemView) {
public TopicsHotItemView(Activity context, View itemView) {
super(context, itemView);

config = new ImageConfig();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.aisen.weibo.sina.ui.fragment.images;

import android.app.Activity;
import android.content.Context;
import android.graphics.Rect;
import android.net.Uri;
Expand Down Expand Up @@ -148,7 +149,7 @@ public static class NormalPhotoItem extends ARecycleViewItemView<SavedImageBean>

final int size;

public NormalPhotoItem(Context context, BitmapOwner owner, View itemView) {
public NormalPhotoItem(Activity context, BitmapOwner owner, View itemView) {
super(context, itemView);

this.owner = owner;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class SearchHeaderView extends ARecycleViewItemView<StatusContent> implem
RecyclerView mRecycleView;

private APagingFragment fragment;
private BasicRecycleViewAdapter<SearchsResultUser> basicRecycleViewAdapter;
private BasicRecycleViewAdapter<SearchsResultUser, RecyclerView> basicRecycleViewAdapter;

public SearchHeaderView(APagingFragment fragment, View itemView) {
super(fragment.getActivity(), itemView);
Expand All @@ -59,12 +59,12 @@ public void onBindView(View convertView) {

GridLayoutManager linearLayoutManager = new GridLayoutManager(fragment.getActivity(), 2, LinearLayoutManager.HORIZONTAL, false);
mRecycleView.setLayoutManager(linearLayoutManager);
basicRecycleViewAdapter = new BasicRecycleViewAdapter(fragment, new HeaderItemCreator(), new ArrayList<>());
basicRecycleViewAdapter = new BasicRecycleViewAdapter(fragment.getActivity(), mRecycleView, new HeaderItemCreator(), new ArrayList<>());
basicRecycleViewAdapter.setOnItemClickListener(new AdapterView.OnItemClickListener() {

@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
UserProfileActivity.launch(fragment.getActivity(), basicRecycleViewAdapter.getDatas().get(position).getScreen_name());
UserProfileActivity.launch(fragment.getActivity(), basicRecycleViewAdapter.getData(position).getScreen_name());
}

});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.aisen.weibo.sina.ui.fragment.timeline;

import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
Expand Down Expand Up @@ -144,7 +145,7 @@ public IITemView<StatusContent> newItemView(View convertView, int viewType) {

@Override
protected IPagingAdapter<StatusContent> newAdapter(ArrayList<StatusContent> datas) {
return new TimelineAdapter(this, configItemViewCreator(), datas);
return new TimelineAdapter(configItemViewCreator(), datas);
}

@Override
Expand Down Expand Up @@ -192,10 +193,10 @@ protected int timelineCount() {
return AppSettings.getCommentCount();
}

class TimelineAdapter extends BasicRecycleViewAdapter<StatusContent> {
class TimelineAdapter extends BasicRecycleViewAdapter<StatusContent, RecyclerView> {

public TimelineAdapter(APagingFragment holderFragment, IItemViewCreator<StatusContent> itemViewCreator, ArrayList<StatusContent> datas) {
super(holderFragment, itemViewCreator, datas);
public TimelineAdapter(IItemViewCreator<StatusContent> itemViewCreator, ArrayList<StatusContent> datas) {
super(getActivity(), getRefreshView(), itemViewCreator, datas);
}

@Override
Expand Down
2 changes: 2 additions & 0 deletions library/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/build
library.iml
2 changes: 2 additions & 0 deletions library/ReadME.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1.0.1
1、修复Gradle自动产生的字段$change导致建表失败的BUG
38 changes: 38 additions & 0 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 23
buildToolsVersion '23.0.2'

defaultConfig {
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0.1"
}

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

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.alibaba:fastjson:1.2.6'
// compile 'com.nineoldandroids:library:2.4.0'
// compile 'asia.ivity.android:drag-sort-listview:1.0'
// compile 'com.nhaarman.listviewanimations:lib-core:3.1.0@aar'
// compile 'com.nhaarman.listviewanimations:lib-manipulation:3.1.0@aar'
// compile 'com.nhaarman.listviewanimations:lib-core-slh:3.1.0@aar'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
compile 'com.squareup.okhttp:okhttp:2.6.0'
}

122 changes: 122 additions & 0 deletions library/library.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":library" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="AisenWeiBo" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":library" />
</configuration>
</facet>
<facet type="java-gradle" name="Java-Gradle">
<configuration>
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
<option name="BUILDABLE" value="false" />
</configuration>
</facet>
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="debug" />
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
<afterSyncTasks>
<task>generateDebugSources</task>
</afterSyncTasks>
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
<option name="LIBRARY_PROJECT" value="true" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/debug" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/.DS_Store" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/annotations" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="animated-vector-drawable-23.2.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.2.1" level="project" />
<orderEntry type="library" exported="" name="recyclerview-v7-23.2.1" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.2.1" level="project" />
<orderEntry type="library" exported="" name="support-vector-drawable-23.2.1" level="project" />
<orderEntry type="library" exported="" name="okio-1.6.0" level="project" />
<orderEntry type="library" exported="" name="design-23.2.1" level="project" />
<orderEntry type="library" exported="" name="okhttp-2.6.0" level="project" />
<orderEntry type="library" exported="" name="fastjson-1.2.6" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-23.2.1" level="project" />
</component>
</module>
Loading

0 comments on commit a6cc4f2

Please sign in to comment.