Skip to content

Commit

Permalink
Merge pull request #4 from likebamboo/feature/feedback
Browse files Browse the repository at this point in the history
feedback is ok
  • Loading branch information
likebamboo committed Jul 16, 2015
2 parents d5c11cd + 692f53d commit 515fd16
Show file tree
Hide file tree
Showing 14 changed files with 797 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
android:name="com.likebamboo.osa.android.ui.BlogActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="adjustPan"/>
android:windowSoftInputMode="adjustResize"/>
<activity
android:name="com.likebamboo.osa.android.ui.TagBlogActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package com.likebamboo.osa.android.entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
* Created by wentaoli on 2015/5/12.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class BaseRsp {
/**
* 返回信息
Expand Down
86 changes: 86 additions & 0 deletions app/src/main/java/com/likebamboo/osa/android/entity/Feedback.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@

package com.likebamboo.osa.android.entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.ArrayList;

/**
* 问题表
*
* @author wentaoli
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class Feedback {
/**
* 联系方式
*/
private String contact = "";

/**
* 描述
*/
private String description = "";

/**
* 添加时间
*/
@JsonProperty("add_time")
private String addTime = "";

/**
* 反馈的问题列表
*/
@JsonProperty("issue")
private ArrayList<String> issues = null;

@JsonProperty("blogId")
private Long blogId = 0L;

public String getAddTime() {
return addTime;
}

public void setAddTime(String addTime) {
this.addTime = addTime;
}

public String getContact() {
return contact;
}

public void setContact(String contact) {
this.contact = contact;
}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

public ArrayList<String> getIssues() {
return issues;
}

public void setIssues(ArrayList<String> issuesArr) {
this.issues = issuesArr;
}

public Long getBlogId() {
return blogId;
}

public void setBlogId(Long blogId) {
this.blogId = blogId;
}

@Override
public String toString() {
return "Feedback [contact=" + contact + ", description=" + description + ", addTime=" + addTime + ", issues=" + issues + "]";
}

}
111 changes: 111 additions & 0 deletions app/src/main/java/com/likebamboo/osa/android/entity/IssueList.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@

package com.likebamboo.osa.android.entity;

import android.os.Parcel;
import android.os.Parcelable;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.ArrayList;

/**
* Created by wentaoli on 2015/7/16.
*/
public class IssueList extends BaseRsp {

@JsonProperty("result")
private ArrayList<Issue> mList = null;

public ArrayList<Issue> getList() {
return mList;
}

public void setList(ArrayList<Issue> list) {
this.mList = list;
}

/**
* 问题表
*
* @author likebamboo
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public static class Issue implements Parcelable {

/**
* 名称
*/
private String name = "";

/**
* 描述
*/
private String description = "";

/**
* 添加时间
*/
private String addTime = "";

public String getAddTime() {
return addTime;
}

public void setAddTime(String addTime) {
this.addTime = addTime;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

@Override
public String toString() {
return "issue [name=" + name + "]";
}

@Override
public int describeContents() {
return 0;
}

@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(this.name);
dest.writeString(this.description);
dest.writeString(this.addTime);
}

public Issue() {
}

private Issue(Parcel in) {
this.name = in.readString();
this.description = in.readString();
this.addTime = in.readString();
}

public static final Parcelable.Creator<Issue> CREATOR = new Parcelable.Creator<Issue>() {
public Issue createFromParcel(Parcel source) {
return new Issue(source);
}

public Issue[] newArray(int size) {
return new Issue[size];
}
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ public class RequestUrl {
*/
public static final String TAG_BLOG_URL = BLOG_URL + "/tag/%s/";

/**
* issues
*/
public static final String ISSUES_LIST_URL = BASE_URL + "issue/";

/**
* feedback.save
*/
public static final String FEEDBACK_SAVE_URL = BASE_URL + "feedback/save?random=%s";

/**
* 关于我
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.likebamboo.osa.android.request.RequestManager;
import com.likebamboo.osa.android.request.RequestUrl;
import com.likebamboo.osa.android.ui.fragments.BlogInfoFragment;
import com.likebamboo.osa.android.ui.fragments.FeedbackFragment;
import com.likebamboo.osa.android.ui.nav.ActivityNavigator;
import com.likebamboo.osa.android.ui.view.CommonWebView;
import com.likebamboo.osa.android.ui.view.LoadingLayout;
Expand Down Expand Up @@ -229,11 +230,34 @@ public void onClick(View view) {
doUnFavorite();
}
});

// 反馈
mIssueTv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//TODO 反馈
// 反馈
if (isFinishing()) {
return;
}
if (mBlogInfo != null) {
// 显示博客详情信息
FeedbackFragment fragment = FeedbackFragment.getInstance(mBlogInfo.getBlogId(), mBlogInfo.getTitle());
fragment.show(getSupportFragmentManager(), "feedback");
return;
}
// 加载博客信息
loadBlogInfo(new Response.Listener<BlogList.Blog>() {
@Override
public void onResponse(BlogList.Blog blog) {
mLoadingLayout.showLoading(false);
if (blog != null) {
mBlogInfo = blog;
// 显示博客详情信息
FeedbackFragment fragment = FeedbackFragment.getInstance(mBlogInfo.getBlogId(), mBlogInfo.getTitle());
fragment.show(getSupportFragmentManager(), "feedback");
}
}
});
}
});

Expand Down
Loading

0 comments on commit 515fd16

Please sign in to comment.