Skip to content

Commit f5d7d14

Browse files
committed
Accept Pull Request #802 : (ashuo:merged -> coding:merge410)
Pull Request: 项目内外筛选 修复bug Created By: @阿朔 Accepted By: @陈超 URL: https://coding.net/u/coding/p/Coding-Android/git/pull/802
2 parents 93e36b2 + c8a75dd commit f5d7d14

File tree

4 files changed

+28
-12
lines changed

4 files changed

+28
-12
lines changed

app/src/main/java/net/coding/program/common/DrawerLayoutHelper.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,14 @@ public static DrawerLayoutHelper getInstance() {
4646

4747
/**
4848
* @param context
49-
* @param projectInner 是不是显示标签数量
5049
* @param drawerLayout
5150
* @param filterModel
5251
* @param filterListener
5352
*/
54-
public void initData(Context context, boolean projectInner, DrawerLayout drawerLayout, FilterModel filterModel, FilterListener filterListener) {
53+
public void initData(Context context, DrawerLayout drawerLayout, FilterModel filterModel, FilterListener filterListener) {
5554
this.mContext = context;
5655
this.mFilterModel = filterModel;
57-
this.showLabelCount = !projectInner;
56+
this.showLabelCount = false;
5857
font2 = mContext.getResources().getColor(R.color.font_2);
5958
green = mContext.getResources().getColor(R.color.green);
6059

@@ -105,7 +104,6 @@ private void dismiss() {
105104
}
106105

107106
private void iniLabels(FilterListener filterListener, EditText etSearch) {
108-
109107
if (mFilterModel == null || mFilterModel.labelModels == null || mFilterModel.labelModels.size() == 0) {
110108
return;
111109
}

app/src/main/java/net/coding/program/project/detail/TaskFilterFragment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ protected final void actionFilter() {
192192
}
193193
}
194194

195-
DrawerLayoutHelper.getInstance().initData(getContext(), isProjectInner(), drawerLayout, mFilterModel, new FilterListener() {
195+
DrawerLayoutHelper.getInstance().initData(getContext(), drawerLayout, mFilterModel, new FilterListener() {
196196
@Override
197197
public void callback(FilterModel filterModel) {
198198
mFilterModel = filterModel;

app/src/main/java/net/coding/program/project/detail/TaskListFragment.java

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import android.content.Intent;
55
import android.graphics.PorterDuff;
66
import android.os.Bundle;
7-
import android.support.v4.app.Fragment;
87
import android.text.TextUtils;
98
import android.view.LayoutInflater;
109
import android.view.View;
@@ -23,7 +22,6 @@
2322
import net.coding.program.common.BlankViewDisplay;
2423
import net.coding.program.common.Global;
2524
import net.coding.program.common.ListModify;
26-
import net.coding.program.common.network.LoadingFragment;
2725
import net.coding.program.common.network.RefreshBaseFragment;
2826
import net.coding.program.common.umeng.UmengEvent;
2927
import net.coding.program.common.util.BlankViewHelp;
@@ -182,9 +180,30 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
182180
String checkHostFilter() {
183181
String host = "";
184182
int userId = mMembers.user_id;
185-
if (!TextUtils.isEmpty(mMeAction) && userId != 0) {
186-
host += String.format("%s=%s&", mMeAction, userId);
183+
184+
//项目内 不是全部任务
185+
if (mShowAdd && userId != 0) {
186+
if (!TextUtils.isEmpty(mMeAction)) {
187+
host += String.format("owner=%s&", userId);
188+
}
189+
//关注,创建可以返回数据
190+
if (!TextUtils.isEmpty(mMeAction) && !mMeAction.equals("owner")) {
191+
if (!TextUtils.isEmpty(mMeAction)) {
192+
host += String.format("%s=%s&", mMeAction, MyApp.sUserObject.id);
193+
}
194+
}
195+
} else if (mShowAdd) {
196+
//项目内 全部任务
197+
if (!TextUtils.isEmpty(mMeAction) && !mMeAction.equals("owner")) {
198+
host += String.format("%s=%s&", mMeAction, MyApp.sUserObject.id);
199+
}
200+
} else {
201+
//项目外
202+
if (!TextUtils.isEmpty(mMeAction) && userId != 0) {
203+
host += String.format("%s=%s&", mMeAction, userId);
204+
}
187205
}
206+
188207
if (!TextUtils.isEmpty(mStatus) && !mStatus.equals("0")) {
189208
host += String.format("status=%s&", mStatus);
190209
}

app/src/main/res/layout/dialog_task_filter.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,9 @@
7979

8080
<com.flyco.roundview.RoundRelativeLayout
8181
android:layout_width="match_parent"
82-
android:layout_height="35dp"
82+
android:layout_height="50dp"
8383
android:layout_marginLeft="20dp"
84-
android:layout_marginRight="20dp"
85-
android:layout_marginTop="15dp">
84+
android:layout_marginRight="20dp">
8685

8786
<EditText
8887
android:id="@+id/et_search"

0 commit comments

Comments
 (0)