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

26
LINES

< > BotCompany Repo | #1023256 // Test onWindowVisibilityChanged (Android)

JavaX source code (Android) [tags: use-pretranspiled] - run with: the app

Libraryless. Click here for Pure Java version (1799L/12K/44K).

1  
!7
2  
3  
import android.widget.*;
4  
import android.view.*;
5  
6  
set flag AndroidOnly.
7  
8  
sS androidVisibilityToString(int v) {
9  
  ret v == View.GONE ? "gone"
10  
    : v == View.INVISIBLE ? "invisible"
11  
    : v == View.VISIBLE ? "visible"
12  
    : "unknown (" + v + ")";
13  
}
14  
15  
p {
16  
  androidUI(r {
17  
    TextView view = new TextView(androidActivity()) {
18  
      protected void onWindowVisibilityChanged(int visibility) {
19  
        super.onWindowVisibilityChanged(visibility);
20  
        setText(getText() + "\n" + localTimeWithSeconds() + ": " + androidVisibilityToString(visibility));
21  
      }
22  
    };
23  
    view.setText("Testi testi");
24  
    aSetView(view);
25  
  });
26  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, odkhaoglnmdk, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1023256
Snippet name: Test onWindowVisibilityChanged (Android)
Eternal ID of this version: #1023256/10
Text MD5: f680bb327f72194f85706188ef5e3151
Transpilation MD5: 7e7c6858f8961fcc7c218a3e10ac78b9
Author: stefan
Category: javax
Type: JavaX source code (Android)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-05-20 15:17:16
Source code size: 651 bytes / 26 lines
Pitched / IR pitched: No / No
Views / Downloads: 212 / 328
Version history: 9 change(s)
Referenced in: [show references]