├── app ├── .gitignore ├── src │ └── main │ │ ├── res │ │ ├── values │ │ │ ├── strings.xml │ │ │ ├── colors.xml │ │ │ ├── dimens.xml │ │ │ ├── attrs.xml │ │ │ └── styles.xml │ │ ├── drawable │ │ │ ├── event_di.9.png │ │ │ ├── ratingbar_progress.xml │ │ │ └── background_white_round.xml │ │ ├── mipmap-hdpi │ │ │ ├── feed_more.png │ │ │ ├── event_favour.png │ │ │ ├── ic_launcher.png │ │ │ ├── icon_emoji.png │ │ │ ├── event_comment.png │ │ │ └── sale_icon_star.png │ │ ├── values-w820dp │ │ │ └── dimens.xml │ │ ├── layout │ │ │ ├── activity_news_link.xml │ │ │ ├── item_evaluatereply.xml │ │ │ ├── activity_evaluation.xml │ │ │ ├── item_empty.xml │ │ │ ├── fragment_news.xml │ │ │ ├── activity_news.xml │ │ │ ├── popup_reply.xml │ │ │ ├── replay_input.xml │ │ │ ├── item_news.xml │ │ │ ├── activity_main.xml │ │ │ ├── dialog.xml │ │ │ └── item_evaluate.xml │ │ └── anim │ │ │ ├── dialog_exit.xml │ │ │ ├── dialog_enter.xml │ │ │ ├── reply_window_enter.xml │ │ │ └── reply_window_exit.xml │ │ ├── java │ │ └── com │ │ │ └── lzy │ │ │ └── ninegridview │ │ │ ├── utils │ │ │ ├── Urls.java │ │ │ └── GlobalDialog.java │ │ │ ├── model │ │ │ ├── news │ │ │ │ ├── bean │ │ │ │ │ ├── NewsChannel.java │ │ │ │ │ ├── NewsImage.java │ │ │ │ │ └── NewsContent.java │ │ │ │ ├── NewsLinkActivity.java │ │ │ │ ├── NewsContentAdapter.java │ │ │ │ ├── NewsActivity.java │ │ │ │ └── NewsFragment.java │ │ │ └── evaluation │ │ │ │ ├── bean │ │ │ │ ├── Avatar.java │ │ │ │ ├── EvaluationReply.java │ │ │ │ ├── EvaluationPic.java │ │ │ │ ├── BaseData.java │ │ │ │ ├── Evaluation.java │ │ │ │ └── EvaluationItem.java │ │ │ │ ├── CommentsAdapter.java │ │ │ │ ├── EvaluationActivity.java │ │ │ │ └── EvaluationAdapter.java │ │ │ ├── callback │ │ │ ├── NewsCallBack.java │ │ │ └── JsonCallback.java │ │ │ ├── GApp.java │ │ │ └── MainActivity.java │ │ └── AndroidManifest.xml ├── proguard-rules.pro ├── build.gradle └── app.iml ├── ninegridview ├── .gitignore ├── src │ └── main │ │ ├── res │ │ ├── values │ │ │ ├── strings.xml │ │ │ ├── colors.xml │ │ │ └── attrs.xml │ │ ├── drawable │ │ │ └── ic_default_color.xml │ │ └── layout │ │ │ ├── item_photoview.xml │ │ │ └── activity_preview.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── lzy │ │ └── ninegrid │ │ ├── preview │ │ ├── HackyViewPager.java │ │ ├── NineGridViewClickAdapter.java │ │ ├── ImagePreviewAdapter.java │ │ └── ImagePreviewActivity.java │ │ ├── NineGridViewAdapter.java │ │ ├── ImageInfo.java │ │ ├── NineGridViewWrapper.java │ │ └── NineGridView.java ├── proguard-rules.pro ├── build.gradle └── ninegridview.iml ├── settings.gradle ├── .gitignore ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradle.properties ├── NineGridView.iml ├── gradlew.bat ├── bintray.gradle ├── README.md └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /ninegridview/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':ninegridview' 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | .idea 4 | /local.properties 5 | .DS_Store 6 | /build 7 | /captures 8 | /screenshots -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | NineGridView 3 | 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeasonlzy/NineGridView/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable/event_di.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeasonlzy/NineGridView/HEAD/app/src/main/res/drawable/event_di.9.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/feed_more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeasonlzy/NineGridView/HEAD/app/src/main/res/mipmap-hdpi/feed_more.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/event_favour.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeasonlzy/NineGridView/HEAD/app/src/main/res/mipmap-hdpi/event_favour.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeasonlzy/NineGridView/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/icon_emoji.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeasonlzy/NineGridView/HEAD/app/src/main/res/mipmap-hdpi/icon_emoji.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/event_comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeasonlzy/NineGridView/HEAD/app/src/main/res/mipmap-hdpi/event_comment.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/sale_icon_star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeasonlzy/NineGridView/HEAD/app/src/main/res/mipmap-hdpi/sale_icon_star.png -------------------------------------------------------------------------------- /ninegridview/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | %1$s/%2$s 4 | -------------------------------------------------------------------------------- /ninegridview/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #33000000 4 | -------------------------------------------------------------------------------- /ninegridview/src/main/res/drawable/ic_default_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ratingbar_progress.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Oct 07 00:27:20 CST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_news_link.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_evaluatereply.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/anim/dialog_exit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/anim/dialog_enter.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/anim/reply_window_enter.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/anim/reply_window_exit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 13 | 14 | -------------------------------------------------------------------------------- /ninegridview/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /ninegridview/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/background_white_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 14 | 15 | 16 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_evaluation.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in E:\Android\SDK/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /ninegridview/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in E:\Android\SDK/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzy/ninegridview/utils/Urls.java: -------------------------------------------------------------------------------- 1 | package com.lzy.ninegridview.utils; 2 | 3 | /** 4 | * ================================================ 5 | * 作 者:廖子尧 6 | * 版 本:1.0 7 | * 创建日期:2016/3/20 8 | * 描 述: 9 | * 修订历史: 10 | * ================================================ 11 | */ 12 | public class Urls { 13 | public static final String Evaluation = "http://123.57.162.168:8081/mall/app/goods/evaluation/list.json"; 14 | public static final String CHANNEL = "http://apis.baidu.com/showapi_open_bus/channel_news/channel_news"; 15 | public static final String NEWS = "http://apis.baidu.com/showapi_open_bus/channel_news/search_news"; 16 | public static final String APIKEY = "593e074aa96b18276fbe1aec8992f398"; 17 | } 18 | -------------------------------------------------------------------------------- /ninegridview/src/main/res/layout/item_photoview.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_empty.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_news.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | 16 | 17 | -------------------------------------------------------------------------------- /ninegridview/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 24 5 | buildToolsVersion "24.0.3" 6 | 7 | defaultConfig { 8 | minSdkVersion 11 9 | targetSdkVersion 24 10 | versionCode 1 11 | versionName "1.0" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | compile fileTree(include: ['*.jar'], dir: 'libs') 23 | compile 'com.android.support:appcompat-v7:24.2.1' 24 | compile 'com.android.support:support-annotations:24.2.1' 25 | compile 'com.github.chrisbanes.photoview:library:1.2.4' 26 | } 27 | 28 | //apply from: '../bintray.gradle' -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /ninegridview/src/main/res/layout/activity_preview.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_news.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 17 | 18 | 22 | 23 | -------------------------------------------------------------------------------- /NineGridView.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzy/ninegridview/model/news/bean/NewsChannel.java: -------------------------------------------------------------------------------- 1 | package com.lzy.ninegridview.model.news.bean; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * ================================================ 7 | * 作 者:廖子尧 8 | * 版 本:1.0 9 | * 创建日期:2016/3/20 10 | * 描 述: 11 | * 修订历史: 12 | * ================================================ 13 | */ 14 | public class NewsChannel implements Serializable { 15 | private String channelId; 16 | private String name; 17 | 18 | public String getChannelId() { 19 | return channelId; 20 | } 21 | 22 | public void setChannelId(String channelId) { 23 | this.channelId = channelId; 24 | } 25 | 26 | public String getName() { 27 | return name; 28 | } 29 | 30 | public void setName(String name) { 31 | this.name = name; 32 | } 33 | 34 | @Override 35 | public String toString() { 36 | return "NewsChannel{" + 37 | "channelId='" + channelId + '\'' + 38 | ", name='" + name + '\'' + 39 | '}'; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzy/ninegridview/model/evaluation/bean/Avatar.java: -------------------------------------------------------------------------------- 1 | package com.lzy.ninegridview.model.evaluation.bean; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * ================================================ 7 | * 作 者:廖子尧 8 | * 版 本:1.0 9 | * 创建日期:2016/3/20 10 | * 描 述:用户头像信息 11 | * 修订历史: 12 | * ================================================ 13 | */ 14 | 15 | public class Avatar implements Serializable { 16 | public String mongoId; 17 | public String picUrl; 18 | public String smallPicUrl; 19 | 20 | public String getMongoId() { 21 | return mongoId; 22 | } 23 | 24 | public void setMongoId(String mongoId) { 25 | this.mongoId = mongoId; 26 | } 27 | 28 | public String getPicUrl() { 29 | return picUrl; 30 | } 31 | 32 | public void setPicUrl(String picUrl) { 33 | this.picUrl = picUrl; 34 | } 35 | 36 | public String getSmallPicUrl() { 37 | return smallPicUrl; 38 | } 39 | 40 | public void setSmallPicUrl(String smallPicUrl) { 41 | this.smallPicUrl = smallPicUrl; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzy/ninegridview/model/news/NewsLinkActivity.java: -------------------------------------------------------------------------------- 1 | package com.lzy.ninegridview.model.news; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.webkit.WebView; 6 | import android.webkit.WebViewClient; 7 | 8 | import com.lzy.ninegridview.R; 9 | 10 | import butterknife.Bind; 11 | import butterknife.ButterKnife; 12 | 13 | public class NewsLinkActivity extends AppCompatActivity { 14 | 15 | @Bind(R.id.webView) WebView webView; 16 | 17 | @Override 18 | protected void onCreate(Bundle savedInstanceState) { 19 | super.onCreate(savedInstanceState); 20 | setContentView(R.layout.activity_news_link); 21 | ButterKnife.bind(this); 22 | 23 | String link = getIntent().getStringExtra("link"); 24 | webView.setWebViewClient(new WebViewClient() { 25 | @Override 26 | public boolean shouldOverrideUrlLoading(WebView view, String url) { 27 | view.loadUrl(url); 28 | return true; 29 | } 30 | }); 31 | webView.loadUrl(link); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /ninegridview/src/main/java/com/lzy/ninegrid/preview/HackyViewPager.java: -------------------------------------------------------------------------------- 1 | package com.lzy.ninegrid.preview; 2 | 3 | import android.content.Context; 4 | import android.support.v4.view.ViewPager; 5 | import android.util.AttributeSet; 6 | import android.view.MotionEvent; 7 | 8 | /** 修复图片在ViewPager控件中缩放报错的BUG */ 9 | public class HackyViewPager extends ViewPager { 10 | 11 | public HackyViewPager(Context context) { 12 | super(context); 13 | } 14 | 15 | public HackyViewPager(Context context, AttributeSet attrs) { 16 | super(context, attrs); 17 | } 18 | 19 | @Override 20 | public boolean onTouchEvent(MotionEvent ev) { 21 | try { 22 | return super.onTouchEvent(ev); 23 | } catch (IllegalArgumentException ex) { 24 | ex.printStackTrace(); 25 | } 26 | return false; 27 | } 28 | 29 | @Override 30 | public boolean onInterceptTouchEvent(MotionEvent ev) { 31 | try { 32 | return super.onInterceptTouchEvent(ev); 33 | } catch (IllegalArgumentException ex) { 34 | ex.printStackTrace(); 35 | } 36 | return false; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzy/ninegridview/callback/NewsCallBack.java: -------------------------------------------------------------------------------- 1 | package com.lzy.ninegridview.callback; 2 | 3 | import com.lzy.ninegridview.utils.Urls; 4 | import com.lzy.okhttputils.callback.AbsCallback; 5 | import com.lzy.okhttputils.model.HttpHeaders; 6 | import com.lzy.okhttputils.request.BaseRequest; 7 | 8 | import java.io.IOException; 9 | 10 | import okhttp3.Response; 11 | 12 | /** 13 | * ================================================ 14 | * 作 者:廖子尧 15 | * 版 本:1.0 16 | * 创建日期:2016/3/20 17 | * 描 述: 18 | * 修订历史: 19 | * ================================================ 20 | */ 21 | public abstract class NewsCallBack extends AbsCallback { 22 | @Override 23 | public void onBefore(BaseRequest request) { 24 | HttpHeaders headers = new HttpHeaders(); 25 | headers.put("apikey", Urls.APIKEY); 26 | request.headers(headers); 27 | } 28 | 29 | @Override 30 | public String parseNetworkResponse(Response response) { 31 | try { 32 | return response.body().string(); 33 | } catch (IOException e) { 34 | e.printStackTrace(); 35 | } 36 | return null; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzy/ninegridview/model/evaluation/bean/EvaluationReply.java: -------------------------------------------------------------------------------- 1 | package com.lzy.ninegridview.model.evaluation.bean; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 评价列表的回复详情 */ 6 | public class EvaluationReply implements Serializable { 7 | public int erid; //回复id 8 | public String erContent; //回复内容 9 | public String erReplyuser; //回复人姓名 10 | public String erReplytime; //回复时间 11 | 12 | public int getErid() { 13 | return erid; 14 | } 15 | 16 | public void setErid(int erid) { 17 | this.erid = erid; 18 | } 19 | 20 | public String getErContent() { 21 | return erContent; 22 | } 23 | 24 | public void setErContent(String erContent) { 25 | this.erContent = erContent; 26 | } 27 | 28 | public String getErReplyuser() { 29 | return erReplyuser; 30 | } 31 | 32 | public void setErReplyuser(String erReplyuser) { 33 | this.erReplyuser = erReplyuser; 34 | } 35 | 36 | public String getErReplytime() { 37 | return erReplytime; 38 | } 39 | 40 | public void setErReplytime(String erReplytime) { 41 | this.erReplytime = erReplytime; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzy/ninegridview/model/news/bean/NewsImage.java: -------------------------------------------------------------------------------- 1 | package com.lzy.ninegridview.model.news.bean; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * ================================================ 7 | * 作 者:廖子尧 8 | * 版 本:1.0 9 | * 创建日期:2016/3/20 10 | * 描 述: 11 | * 修订历史: 12 | * ================================================ 13 | */ 14 | public class NewsImage implements Serializable { 15 | private int width; 16 | private int height; 17 | private String url; 18 | 19 | public int getWidth() { 20 | return width; 21 | } 22 | 23 | public void setWidth(int width) { 24 | this.width = width; 25 | } 26 | 27 | public int getHeight() { 28 | return height; 29 | } 30 | 31 | public void setHeight(int height) { 32 | this.height = height; 33 | } 34 | 35 | public String getUrl() { 36 | return url; 37 | } 38 | 39 | public void setUrl(String url) { 40 | this.url = url; 41 | } 42 | 43 | @Override 44 | public String toString() { 45 | return "NewsImage{" + 46 | "width=" + width + 47 | ", height=" + height + 48 | ", url='" + url + '\'' + 49 | '}'; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/res/layout/popup_reply.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 21 | 22 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 24 5 | buildToolsVersion "24.0.3" 6 | 7 | defaultConfig { 8 | minSdkVersion 14 9 | targetSdkVersion 24 10 | versionCode 1 11 | versionName "1.0" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | compile fileTree(include: ['*.jar'], dir: 'libs') 23 | compile 'com.android.support:appcompat-v7:24.2.1' 24 | compile 'com.android.support:recyclerview-v7:24.2.1' 25 | compile 'com.jakewharton:butterknife:7.0.1' 26 | compile 'com.google.code.gson:gson:2.6.2' 27 | compile 'in.srain.cube:ultra-ptr:1.0.11' 28 | compile 'com.lzy.net:okhttputils:1.5.2' 29 | compile 'com.lzy.widget:view-core:0.2.1' 30 | 31 | compile 'org.xutils:xutils:3.3.36' 32 | compile 'com.facebook.fresco:fresco:0.11.0' 33 | compile 'com.squareup.picasso:picasso:2.5.2' 34 | compile 'com.github.bumptech.glide:glide:3.7.0' 35 | compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5' 36 | 37 | // compile 'com.lzy.widget:ninegridview:+' 38 | compile project(':ninegridview') 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzy/ninegridview/model/evaluation/bean/EvaluationPic.java: -------------------------------------------------------------------------------- 1 | package com.lzy.ninegridview.model.evaluation.bean; 2 | 3 | import java.io.Serializable; 4 | /** 5 | * ================================================ 6 | * 作 者:廖子尧 7 | * 版 本:1.0 8 | * 创建日期:2016/3/20 9 | * 描 述: 10 | * 修订历史: 11 | * ================================================ 12 | */ 13 | 14 | /** 评论的图片信息 */ 15 | public class EvaluationPic implements Serializable { 16 | public int attachmentId; 17 | public String imageId; 18 | public String imageUrl; // 原图 19 | public String smallImageUrl; // 缩略图 20 | 21 | public int getAttachmentId() { 22 | return attachmentId; 23 | } 24 | 25 | public void setAttachmentId(int attachmentId) { 26 | this.attachmentId = attachmentId; 27 | } 28 | 29 | public String getImageId() { 30 | return imageId; 31 | } 32 | 33 | public void setImageId(String imageId) { 34 | this.imageId = imageId; 35 | } 36 | 37 | public String getImageUrl() { 38 | return imageUrl; 39 | } 40 | 41 | public void setImageUrl(String imageUrl) { 42 | this.imageUrl = imageUrl; 43 | } 44 | 45 | public String getSmallImageUrl() { 46 | return smallImageUrl; 47 | } 48 | 49 | public void setSmallImageUrl(String smallImageUrl) { 50 | this.smallImageUrl = smallImageUrl; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzy/ninegridview/model/evaluation/bean/BaseData.java: -------------------------------------------------------------------------------- 1 | package com.lzy.ninegridview.model.evaluation.bean; 2 | 3 | import java.io.Serializable; 4 | 5 | public class BaseData implements Serializable { 6 | 7 | public int code; 8 | public T data; 9 | public String msg; 10 | public long now; 11 | public boolean success; 12 | 13 | public int getCode() { 14 | return code; 15 | } 16 | 17 | public void setCode(int code) { 18 | this.code = code; 19 | } 20 | 21 | public T getData() { 22 | return data; 23 | } 24 | 25 | public void setData(T data) { 26 | this.data = data; 27 | } 28 | 29 | public String getMsg() { 30 | return msg; 31 | } 32 | 33 | public void setMsg(String msg) { 34 | this.msg = msg; 35 | } 36 | 37 | public long getNow() { 38 | return now; 39 | } 40 | 41 | public void setNow(long now) { 42 | this.now = now; 43 | } 44 | 45 | public boolean isSuccess() { 46 | return success; 47 | } 48 | 49 | public void setSuccess(boolean success) { 50 | this.success = success; 51 | } 52 | 53 | @Override 54 | public String toString() { 55 | return "BaseData{" + 56 | "success=" + success + 57 | ", now=" + now + 58 | ", msg='" + msg + '\'' + 59 | ", data=" + data + 60 | ", code=" + code + 61 | '}'; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 21 | 22 | 26 | 27 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/lzy/ninegridview/callback/JsonCallback.java: -------------------------------------------------------------------------------- 1 | package com.lzy.ninegridview.callback; 2 | 3 | import android.text.TextUtils; 4 | 5 | import com.google.gson.Gson; 6 | import com.lzy.okhttputils.callback.AbsCallback; 7 | 8 | import org.json.JSONObject; 9 | 10 | import java.lang.reflect.Type; 11 | 12 | import okhttp3.Response; 13 | 14 | /** 15 | * ================================================ 16 | * 作 者:廖子尧 17 | * 版 本:1.0 18 | * 创建日期:2016/1/14 19 | * 描 述:默认将返回的数据解析成需要的Bean,可以是 BaseBean,String,List,Map 20 | * 修订历史: 21 | * ================================================ 22 | */ 23 | public abstract class JsonCallback extends AbsCallback { 24 | 25 | private Class clazz; 26 | private Type type; 27 | 28 | public JsonCallback(Class clazz) { 29 | this.clazz = clazz; 30 | } 31 | 32 | public JsonCallback(Type type) { 33 | this.type = type; 34 | } 35 | 36 | @Override 37 | public T parseNetworkResponse(Response response) { 38 | try { 39 | String responseData = response.body().string(); 40 | if (TextUtils.isEmpty(responseData)) return null; 41 | 42 | JSONObject jsonObject = new JSONObject(responseData); 43 | String data = jsonObject.optString("data", ""); 44 | if (clazz == String.class) return (T) data; 45 | if (clazz != null) return new Gson().fromJson(data, clazz); 46 | if (type != null) return new Gson().fromJson(data, type); 47 | } catch (Exception e) { 48 | e.printStackTrace(); 49 | } 50 | return null; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /ninegridview/src/main/java/com/lzy/ninegrid/NineGridViewAdapter.java: -------------------------------------------------------------------------------- 1 | package com.lzy.ninegrid; 2 | 3 | import android.content.Context; 4 | import android.widget.ImageView; 5 | 6 | import java.io.Serializable; 7 | import java.util.List; 8 | 9 | public abstract class NineGridViewAdapter implements Serializable { 10 | 11 | protected Context context; 12 | private List imageInfo; 13 | 14 | public NineGridViewAdapter(Context context, List imageInfo) { 15 | this.context = context; 16 | this.imageInfo = imageInfo; 17 | } 18 | 19 | /** 20 | * 如果要实现图片点击的逻辑,重写此方法即可 21 | * 22 | * @param context 上下文 23 | * @param nineGridView 九宫格控件 24 | * @param index 当前点击图片的的索引 25 | * @param imageInfo 图片地址的数据集合 26 | */ 27 | protected void onImageItemClick(Context context, NineGridView nineGridView, int index, List imageInfo) { 28 | } 29 | 30 | /** 31 | * 生成ImageView容器的方式,默认使用NineGridImageViewWrapper类,即点击图片后,图片会有蒙板效果 32 | * 如果需要自定义图片展示效果,重写此方法即可 33 | * 34 | * @param context 上下文 35 | * @return 生成的 ImageView 36 | */ 37 | protected ImageView generateImageView(Context context) { 38 | NineGridViewWrapper imageView = new NineGridViewWrapper(context); 39 | imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); 40 | imageView.setImageResource(R.drawable.ic_default_color); 41 | return imageView; 42 | } 43 | 44 | public List getImageInfo() { 45 | return imageInfo; 46 | } 47 | 48 | public void setImageInfoList(List imageInfo) { 49 | this.imageInfo = imageInfo; 50 | } 51 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/replay_input.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | 20 | 21 | 25 | 26 | 33 | 34 | 40 | 41 | 42 |