Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.imaadv.leaynik.Activities;
- import android.graphics.Typeface;
- import android.os.Bundle;
- import android.support.v7.app.AppCompatActivity;
- import android.support.v7.widget.Toolbar;
- import android.view.View;
- import android.widget.TextView;
- import com.android.volley.toolbox.NetworkImageView;
- import com.imaadv.leaynik.R;
- import com.imaadv.leaynik.adapters.ListViewAdapter;
- import com.imaadv.leaynik.api.API;
- import com.imaadv.leaynik.api.MySingleton;
- import com.imaadv.leaynik.fragment.Profile_Fragment;
- import com.imaadv.leaynik.model.QuestionItem;
- public class ViewAnswers extends AppCompatActivity {
- //private ListView Answers_View;
- //private Button Send;
- //private ImageView UploadImage;
- //private Answers_ListView Adapter;
- //private ArrayList<AnswerItem> Answers = new ArrayList<AnswerItem>();
- private TextView PostContent, PostUsername;
- private NetworkImageView PostUserImage, PostImage;
- //private EditText AnswerConent;
- private TextView Date, AnswersCount;
- //private ProgressBar userimage_prog, postimg_prog;
- private QuestionItem item = new QuestionItem();
- private com.android.volley.toolbox.ImageLoader imageloader;
- private API api;
- //private ProgressDialog dialog;
- private String postid = "";
- //private uploadmultipart uploadParts;
- //private String imagepath;
- TextView answer_title;
- NetworkImageView answer_image;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.disp_notify);
- api = new API(this);
- init();
- }
- private void init() {
- Typeface tf = Typeface.createFromAsset(getAssets(),
- "fonts/GE_SS_Two_Bold.otf");
- Typeface tfreg = Typeface.createFromAsset(getAssets(),
- "fonts/GE_SS_Two_Light.otf");
- Toolbar _toolbar = (Toolbar) findViewById(R.id.toolbar);
- setSupportActionBar(_toolbar);
- getSupportActionBar().setHomeButtonEnabled(true);
- getSupportActionBar().setDisplayHomeAsUpEnabled(true);
- _toolbar.setNavigationOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- onBackPressed();
- }
- });
- imageloader = MySingleton.getInstance(this).getmImageLoader();
- PostContent = (TextView) findViewById(R.id.ques_content);
- PostContent.setTypeface(tfreg);
- answer_title = (TextView) findViewById(R.id.answer_detail);
- answer_image = (NetworkImageView) findViewById(R.id.answer_image);
- PostUsername = (TextView) findViewById(R.id.username_ques);
- PostUsername.setTypeface(tf);
- Date = (TextView) findViewById(R.id.date);
- Date.setTypeface(tfreg);
- //AnswersCount = (TextView) findViewById(R.id.answers_con);
- //AnswersCount.setTypeface(tfreg);
- //Send = (Button) findViewById(R.id.upload_answer);
- //Send.setTypeface(tfreg);
- PostImage = (NetworkImageView) findViewById(R.id.post_img);
- //UploadImage = (ImageView) findViewById(R.id.upload_ans_img);
- PostUserImage = (NetworkImageView) findViewById(R.id.ques_user_img);
- //Answers_View = (ListView) findViewById(R.id.answers_list);
- //AnswerConent = (EditText) findViewById(R.id.answerss_content);
- //AnswerConent.setTypeface(tfreg);
- //userimage_prog = (ProgressBar) findViewById(R.id.userimgae_prog);
- //postimg_prog = (ProgressBar) findViewById(R.id.post_img_pro);
- if (getIntent() != null) {
- if (getIntent().getExtras() != null)
- if (getIntent().getExtras().containsKey("passedobject")) {
- item = (QuestionItem) getIntent().getParcelableExtra("passedobject");
- }
- }
- if (item != null) {
- //Adapter = new Answers_ListView(this, item.answers);
- //Answers_View.setAdapter(Adapter);
- PostContent.setText(item.Que_Content);
- PostUsername.setText(item.user.username);
- Date.setText(item.Que_Date);
- postid = item.Que_ID;
- //AnswersCount.setText(item.answers.size() + " "+getResources().getString(R.string.answers));
- if (item.Que_image_url != null) {
- if (!item.Que_image_url.contentEquals("")) {
- PostImage.setImageUrl(ListViewAdapter.BASE_POST_URl + item.Que_image_url, imageloader);
- }
- }
- if (item.user != null) {
- if (item.user.userimageURL != null) {
- if (!item.user.userimageURL.contentEquals("")) {
- PostUserImage.setImageUrl(Profile_Fragment.BASE_URL + item.user.userimageURL, imageloader);
- }
- }
- }
- if(item.comment != null){
- answer_title.setText(item.comment);
- }
- if(item.comment_photo != null){
- answer_image.setImageUrl(item.comment_photo , imageloader);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement