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

22
LINES

< > BotCompany Repo | #1014894 // aImageButton - make Android image button

JavaX fragment (include)

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

static ImageButton aImageButton(fS imageID, fO action) {
  ret androidUI(func -> ImageButton {
    final ImageButton b = new(androidActivity());
    aSetImageFromSnippet(b, imageID);
    if (action != null)
      b.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
          pcallF(action);
        }
      });
    ret b;
  });
}

static ImageButton aImageButton(S imageID) {
  ret aImageButton(imageID, null);
}

Author comment

Began life as a copy of #1008233

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1014894
Snippet name: aImageButton - make Android image button
Eternal ID of this version: #1014894/5
Text MD5: b0db17280a9036f4f1ac84f6df42f7b4
Author: stefan
Category: javax / android
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-06 10:09:26
Source code size: 567 bytes / 22 lines
Pitched / IR pitched: No / No
Views / Downloads: 405 / 451
Version history: 4 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)