Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while (i.hasNext()) {
- tempString = (String) ((DataSnapshot) i.next()).getValue();
- if(tempString.startsWith("http")){
- final int sdk = android.os.Build.VERSION.SDK_INT;
- TextView textView = new TextView(this);
- textView.setTypeface(null, Typeface.BOLD);
- textView.setLayoutParams(params);
- chat_user_name = (String) ((DataSnapshot) i.next()).getValue();
- textView.setTextSize(getResources().getDimension(R.dimen.textsize));
- if(Objects.equals(chat_user_name, user_name)){
- textView.setText("You sent an image below");
- textView.setTextColor(Color.BLACK);
- params.gravity = Gravity.LEFT;
- if(sdk < android.os.Build.VERSION_CODES.JELLY_BEAN) {
- textView.setBackgroundDrawable( getResources().getDrawable(R.drawable.input_user) );
- textView.setGravity(Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL);
- } else {
- textView.setBackground( getResources().getDrawable(R.drawable.input_user));
- textView.setGravity(Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL);
- }
- textView.setGravity(Gravity.CENTER);
- linearLayout.addView(textView);
- final TextView textView1 = new TextView(this);
- textView1.setText("Tap on image for rotation");
- linearLayout.addView(textView1);
- final ImageView image = new ImageView(this);
- new ImageDownloader(image,uri).execute(tempString);
- image.setLayoutParams(new android.view.ViewGroup.LayoutParams(500,250));
- image.setMaxHeight(500);
- image.setMaxWidth(350);
- image.setAdjustViewBounds(true);
- image.setOnClickListener(new View.OnClickListener(){
- @Override
- public void onClick(View v) {
- image.setRotation((float) 270.0);
- textView1.setText("");
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement