Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

18
LINES

< > BotCompany Repo | #1005198 // androidShowClickableImage - show clickable full-screen image

JavaX fragment (include)

import android.app.Activity;
import android.widget.*;
import android.graphics.*;

static void androidShowClickableImage(final S imageID, final int borderColor, final Runnable onClick) {
  thread "showimg" {
    ImageView iv = new ImageView(androidContext());
    iv.setBackgroundColor(borderColor);
    iv.setImageBitmap(BitmapFactory.decodeFile(loadLibrary(imageID).getPath()));
    if (onClick != null)
      iv.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
          call(onClick);
        }
      });
    androidShow(iv);
  }
}

Author comment

Began life as a copy of #1001281

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1005198
Snippet name: androidShowClickableImage - show clickable full-screen image
Eternal ID of this version: #1005198/1
Text MD5: 88a2ecfe1d23382c31e7716cc4c737f0
Author: stefan
Category: javax android
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-10-22 00:46:54
Source code size: 590 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 450 / 435
Referenced in: [show references]