Skip to content

Commit

Permalink
传媒列表,传媒详情图文部分,点赞, 点赞列表, 评论, 评论的评论, 发布评论, 收藏文章
Browse files Browse the repository at this point in the history
  • Loading branch information
yzykami committed Sep 19, 2017
1 parent e0bce19 commit aaf12e3
Show file tree
Hide file tree
Showing 242 changed files with 7,136 additions and 812 deletions.
5 changes: 2 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,8 @@ android {
}
sourceSets {
main {

jniLibs.srcDirs = ['libs', 'libs-sdk']

}

}
}

Expand Down Expand Up @@ -65,4 +62,6 @@ dependencies {
testCompile 'junit:junit:4.12'
apt 'com.jakewharton:butterknife-compiler:8.4.0'
compile 'de.codecrafters.tableview:tableview:2.8.0'
compile 'cn.lankton:flowlayout:1.0.1'
compile 'org.jsoup:jsoup:1.10.3'
}
68 changes: 40 additions & 28 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,18 @@
android:name=".ui.home.HomeMainActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".ui.home.HomeDetailActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".ui.home.LikeListActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".ui.home.CommentListActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".ui.circle.CirileMainActivity"
android:screenOrientation="portrait"
Expand Down Expand Up @@ -398,39 +410,39 @@
android:resource="@xml/file_paths" />
</provider>

<!-- 声明云信后台服务 -->
<service
android:name="com.netease.nimlib.service.NimService"
android:process=":core" />
<!--&lt;!&ndash; 声明云信后台服务 &ndash;&gt;-->
<!--<service-->
<!--android:name="com.netease.nimlib.service.NimService"-->
<!--android:process=":core" />-->

<!-- 运行后台辅助服务 -->
<service
android:name="com.netease.nimlib.service.NimService$Aux"
android:process=":core" />
<!--&lt;!&ndash; 运行后台辅助服务 &ndash;&gt;-->
<!--<service-->
<!--android:name="com.netease.nimlib.service.NimService$Aux"-->
<!--android:process=":core" />-->

<!-- 声明云信后台辅助服务 -->
<service
android:name="com.netease.nimlib.job.NIMJobService"
android:exported="true"
android:permission="android.permission.BIND_JOB_SERVICE"
android:process=":core" />
<!--&lt;!&ndash; 声明云信后台辅助服务 &ndash;&gt;-->
<!--<service-->
<!--android:name="com.netease.nimlib.job.NIMJobService"-->
<!--android:exported="true"-->
<!--android:permission="android.permission.BIND_JOB_SERVICE"-->
<!--android:process=":core" />-->

<!-- 云信SDK的监视系统启动和网络变化的广播接收器,用户开机自启动以及网络变化时候重新登录 -->
<receiver
android:name="com.netease.nimlib.service.NimReceiver"
android:exported="false"
android:process=":core">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
</intent-filter>
</receiver>
<!--&lt;!&ndash; 云信SDK的监视系统启动和网络变化的广播接收器,用户开机自启动以及网络变化时候重新登录 &ndash;&gt;-->
<!--<receiver-->
<!--android:name="com.netease.nimlib.service.NimReceiver"-->
<!--android:exported="false"-->
<!--android:process=":core">-->
<!--<intent-filter>-->
<!--<action android:name="android.intent.action.BOOT_COMPLETED" />-->
<!--<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />-->
<!--</intent-filter>-->
<!--</receiver>-->

<!-- 云信进程间通信receiver -->
<receiver android:name="com.netease.nimlib.service.ResponseReceiver" />
<!--&lt;!&ndash; 云信进程间通信receiver &ndash;&gt;-->
<!--<receiver android:name="com.netease.nimlib.service.ResponseReceiver" />-->

<!-- 云信进程间通信service -->
<service android:name="com.netease.nimlib.service.ResponseService" />
<!--&lt;!&ndash; 云信进程间通信service &ndash;&gt;-->
<!--<service android:name="com.netease.nimlib.service.ResponseService" />-->
<meta-data
android:name="me.xiaopan.sketchsample.SketchInitializer"
android:value="SKETCH_INITIALIZER" />
Expand Down
50 changes: 37 additions & 13 deletions app/src/main/java/com/tzw/noah/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@
import com.netease.nimlib.sdk.msg.SystemMessageObserver;
import com.netease.nimlib.sdk.msg.SystemMessageService;
import com.tzw.noah.appupdate.UpdateManager;
import com.tzw.noah.cache.UserCache;
import com.tzw.noah.ui.circle.CirileMainActivity;
import com.tzw.noah.ui.friend.FriendMainActivity;
import com.tzw.noah.ui.home.HomeMainActivity;
import com.tzw.noah.ui.mine.LoginActivity;
import com.tzw.noah.ui.mine.MineMainActivity;
import com.tzw.noah.ui.service.ServiceMainActivity;
import com.tzw.noah.ui.sns.SnsMainActivity;
Expand Down Expand Up @@ -192,6 +194,7 @@ public void run() {
}


private int login_requestcode =100;
View.OnClickListener l = new View.OnClickListener() {

public void onClick(View arg0) {
Expand Down Expand Up @@ -228,6 +231,14 @@ public void onClick(View arg0) {

} else if (arg0 == layout3) {

if(!UserCache.isLogin())
{
Intent intent = new Intent(MainActivity.this, LoginActivity.class);
startActivityForResult(intent, login_requestcode);
return;
}


tabHost.setCurrentTabByTag("3");

iv_home.setImageResource(R.drawable.tab_home);
Expand All @@ -241,6 +252,7 @@ public void onClick(View arg0) {
tab_friend_text.setTextColor(getResources().getColorStateList(R.color.myRed));
tab_service_text.setTextColor(getResources().getColorStateList(R.color.mygray));
tab_mine_text.setTextColor(getResources().getColorStateList(R.color.mygray));

} else if (arg0 == layout4) {
tabHost.setCurrentTabByTag("4");

Expand Down Expand Up @@ -276,26 +288,27 @@ public void onClick(View arg0) {
};

private void selectUserTag() {
tabHost.setCurrentTabByTag("3");
if (UserCache.isLogin())
tabHost.setCurrentTabByTag("3");
tabHost.postDelayed(new Runnable() {
@Override
public void run() {
tabHost.setCurrentTabByTag("5");
selectTag(4);
}
}, 100);


iv_home.setImageResource(R.drawable.tab_home);
iv_circle.setImageResource(R.drawable.tab_circle);
iv_service.setImageResource(R.drawable.tab_service);
iv_friend.setImageResource(R.drawable.tab_friend);
iv_mine.setImageResource(R.drawable.tab_mine_clicked);

tab_home_text.setTextColor(getResources().getColorStateList(R.color.mygray));
tab_circle_text.setTextColor(getResources().getColorStateList(R.color.mygray));
tab_service_text.setTextColor(getResources().getColorStateList(R.color.mygray));
tab_friend_text.setTextColor(getResources().getColorStateList(R.color.mygray));
tab_mine_text.setTextColor(getResources().getColorStateList(R.color.myRed));
// iv_home.setImageResource(R.drawable.tab_home);
// iv_circle.setImageResource(R.drawable.tab_circle);
// iv_service.setImageResource(R.drawable.tab_service);
// iv_friend.setImageResource(R.drawable.tab_friend);
// iv_mine.setImageResource(R.drawable.tab_mine_clicked);
//
// tab_home_text.setTextColor(getResources().getColorStateList(R.color.mygray));
// tab_circle_text.setTextColor(getResources().getColorStateList(R.color.mygray));
// tab_service_text.setTextColor(getResources().getColorStateList(R.color.mygray));
// tab_friend_text.setTextColor(getResources().getColorStateList(R.color.mygray));
// tab_mine_text.setTextColor(getResources().getColorStateList(R.color.myRed));

}

Expand Down Expand Up @@ -414,6 +427,17 @@ private void requestSystemMessageUnreadCount() {
ReminderManager.getInstance().updateContactUnreadNum(unread);
}

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == 1) {
selectTag(2);
return;
}
else{
Toast.makeText(MainActivity.this,"请先登录", Toast.LENGTH_SHORT).show();
}
}

private class Monitor implements Runnable {
@Override
public void run() {
Expand Down
41 changes: 40 additions & 1 deletion app/src/main/java/com/tzw/noah/cache/DataCenter.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import com.tzw.noah.models.Group;
import com.tzw.noah.models.GroupMember;
import com.tzw.noah.models.MediaComment;
import com.tzw.noah.models.User;
import com.tzw.noah.utils.Utils;

import java.util.ArrayList;
import java.util.List;
Expand All @@ -24,7 +26,34 @@ public static synchronized DataCenter getInstance() {
return instance;
}

public static int pagesize=5;
public static int screenWidth = Utils.getSrceenWidth();
public static int pagesize = 10;
public static int service_pagesize = 10;
public static int mRadius = 6;
public static String prefix = "http://taizhouwang.oss-cn-beijing.aliyuncs.com";
public static String subfix = "?x-oss-process=image/resize,w_300";
public static String subfix_big = "?x-oss-process=image/resize,w_" + screenWidth;
public static String subfix_round = subfix_big + "/rounded-corners,r_" + mRadius;

public static boolean isAliyunPic(String url) {
if (url.startsWith(prefix))
return true;
return false;
}

public static String formatAliyunPic(String url) {
if (isAliyunPic(url))
url += subfix_round;
return url;
}

public static String recoveryAliyunPic(String url) {
if (url.endsWith(subfix_round)) {
int i = url.indexOf(subfix_round);
url = url.substring(0, 1);
}
return url;
}

List<User> friendList;
List<User> followList;
Expand Down Expand Up @@ -149,4 +178,14 @@ public List<GroupMember> getMemberList() {
public void setMemberList(List<GroupMember> menberList) {
this.memberList = menberList;
}

MediaComment mMediaComment;

public void setMediaComment(MediaComment mediaComment) {
mMediaComment = mediaComment;
}

public MediaComment getMediaComment() {
return mMediaComment;
}
}
Loading

0 comments on commit aaf12e3

Please sign in to comment.