Java Code Examples for android.widget.ListView#setTranscriptMode()

The following examples show how to use android.widget.ListView#setTranscriptMode() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LogsDialog.java    From u2020-mvp with Apache License 2.0 6 votes vote down vote up
public LogsDialog(Context context, LumberYard lumberYard) {
    super(context);
    this.lumberYard = lumberYard;

    adapter = new LogAdapter(context);

    ListView listView = new ListView(context);
    listView.setTranscriptMode(ListView.TRANSCRIPT_MODE_NORMAL);
    listView.setAdapter(adapter);

    setTitle("Logs");
    setView(listView);
    setButton(BUTTON_NEGATIVE, "Close", (dialog, which) -> {
        // NO-OP.
    });
    setButton(BUTTON_POSITIVE, "Share", (dialog, which) -> {
        share();
    });
}
 
Example 2
Source File: LogsDialog.java    From u2020 with Apache License 2.0 6 votes vote down vote up
public LogsDialog(Context context, LumberYard lumberYard) {
  super(context);
  this.lumberYard = lumberYard;

  adapter = new LogAdapter(context);

  ListView listView = new ListView(context);
  listView.setTranscriptMode(ListView.TRANSCRIPT_MODE_NORMAL);
  listView.setAdapter(adapter);

  setTitle("Logs");
  setView(listView);
  setButton(BUTTON_NEGATIVE, "Close", (dialog, which) -> {
    // NO-OP.
  });
  setButton(BUTTON_POSITIVE, "Share", (dialog, which) -> {
    share();
  });
}
 
Example 3
Source File: LogcatViewerFloatingView.java    From LogcatViewer with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Setup list view to show logcat log-entries.
 * @param rootView root view.
 */
private void setupLogListView(final View rootView){
    //Log entry list view
    mListView = (ListView) rootView.findViewById(R.id.list);
    mListView.setStackFromBottom(true);
    mListView.setTranscriptMode(ListView.TRANSCRIPT_MODE_NORMAL);
    mAdapter = new LogcatViewerListAdapter(getApplicationContext());
    mListView.setAdapter(mAdapter);
}
 
Example 4
Source File: LynxView.java    From Lynx with Apache License 2.0 5 votes vote down vote up
private void mapGui() {
  lv_traces = (ListView) findViewById(R.id.lv_traces);
  lv_traces.setTranscriptMode(AbsListView.TRANSCRIPT_MODE_ALWAYS_SCROLL);
  et_filter = (EditText) findViewById(R.id.et_filter);
  ib_share = (ImageButton) findViewById(R.id.ib_share);
  sp_filter = (Spinner) findViewById(R.id.sp_filter);

  configureCursorColor();
  updateFilterText();
}
 
Example 5
Source File: DebugOverlayView.java    From debugoverlay with Apache License 2.0 4 votes vote down vote up
public DebugOverlayView(Context context) {
  super(context);

  windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
  Point windowDimen = new Point();
  windowManager.getDefaultDisplay().getSize(windowDimen);

  int desiredLayoutHeight = dpToPx(context, 100);
  int layoutHeight = desiredLayoutHeight < windowDimen.y ? desiredLayoutHeight : windowDimen.y;

  // Setup the GUI

  // Close Button
  int buttonHeight = dpToPx(context, 40);
  closeButton = new ImageView(context);
  closeButton.setImageResource(R.drawable.ic_close_circle);
  closeButton.setLayoutParams(new FrameLayout.LayoutParams(buttonHeight, buttonHeight, Gravity.TOP | Gravity.END));

  // Logging Console
  adapter = new LoggingAdapter(context);
  listView = new ListView(context);
  listView.setBackgroundColor(Color.parseColor("#64000000"));
  listView.setTranscriptMode(AbsListView.TRANSCRIPT_MODE_ALWAYS_SCROLL);
  listView.setStackFromBottom(true);
  listView.setAdapter(adapter);
  FrameLayout.LayoutParams listViewLayoutParams =
      new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
  listViewLayoutParams.topMargin = buttonHeight / 2;
  listView.setLayoutParams(listViewLayoutParams);

  // Add views
  addView(listView);
  addView(closeButton);

  // Set View parameters
  WindowManager.LayoutParams windowParams;
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
    windowParams = new WindowManager.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, layoutHeight,
        WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, PixelFormat.TRANSLUCENT);
  } else {
    windowParams =
        new WindowManager.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, layoutHeight, WindowManager.LayoutParams.TYPE_PHONE,
            WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, PixelFormat.TRANSLUCENT);
  }

  windowParams.gravity = Gravity.TOP | Gravity.START;
  windowParams.x = 0;
  windowParams.y = windowDimen.y - layoutHeight;

  // Attach and display View
  windowManager.addView(this, windowParams);
}
 
Example 6
Source File: WarActivity.java    From BotLibre with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
	super.superOnCreate(savedInstanceState);
	setContentView(R.layout.activity_war);

	this.instance = StartWarActivity.bot1;
	this.instance1 = StartWarActivity.bot1;
	this.instance2 = StartWarActivity.bot2;
	if (this.instance == null) {
		return;
	}
	this.count = 0;
	this.currentBot = 0;
	this.conversation1 = null;
	this.conversation2 = null;
	this.finished = false;
	/*if (MainActivity.showAds) {
        AdView mAdView = (AdView) findViewById(R.id.adView);
        AdRequest adRequest = new AdRequest.Builder().build();
        mAdView.loadAd(adRequest);
	} else {
        AdView mAdView = (AdView) findViewById(R.id.adView);
   		mAdView.setVisibility(View.GONE);
	}*/
	
	tts = new TextToSpeech(this, this);

	videoView = (VideoView)findViewById(R.id.videoView);
	video1View = videoView;
	video2View = (VideoView)findViewById(R.id.video2View);
	resetVideoErrorListener();
	resetVideoErrorListener2();
	videoError = false;
	
	imageView = (ImageView)findViewById(R.id.imageView);
	image1View = imageView;
	image2View = (ImageView)findViewById(R.id.image2View);
	videoLayout = findViewById(R.id.videoLayout);
	video1Layout = videoLayout;
	video2Layout = findViewById(R.id.video2Layout);

	if (MainActivity.translate) {
		findViewById(R.id.yandex).setVisibility(View.VISIBLE);
	} else {
		findViewById(R.id.yandex).setVisibility(View.GONE);
	}
	
	ListView list = (ListView) findViewById(R.id.chatList);
	list.setAdapter(new ChatListAdapter(this, R.layout.chat_list, this.messages));
	list.setTranscriptMode(ListView.TRANSCRIPT_MODE_ALWAYS_SCROLL);

	HttpGetImageAction.fetchImage(this, instance.avatar, imageView);
	HttpGetImageAction.fetchImage(this, instance.avatar, (ImageView)findViewById(R.id.responseImageView));

	HttpGetImageAction.fetchImage(this, instance2.avatar, (ImageView)findViewById(R.id.image2View));
	
	ChatConfig config = new ChatConfig();
	config.instance = instance.id;
	config.message = StartWarActivity.topic;
	config.avatar = this.avatarId;
	if (MainActivity.translate && MainActivity.voice != null) {
		config.language = MainActivity.voice.language;
	}
	if (MainActivity.disableVideo) {
		config.avatarFormat = "image";
	} else {
		config.avatarFormat = MainActivity.webm ? "webm" : "mp4";
	}
	config.avatarHD = MainActivity.hd;
	config.speak = !MainActivity.deviceVoice;
	HttpAction action = new HttpChatAction(WarActivity.this, config);
	action.execute();
}
 
Example 7
Source File: WarActivity.java    From BotLibre with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
	super.superOnCreate(savedInstanceState);
	setContentView(R.layout.activity_war);

	this.instance = StartWarActivity.bot1;
	this.instance1 = StartWarActivity.bot1;
	this.instance2 = StartWarActivity.bot2;
	if (this.instance == null) {
		return;
	}
	this.count = 0;
	this.currentBot = 0;
	this.conversation1 = null;
	this.conversation2 = null;
	this.finished = false;
	/*if (MainActivity.showAds) {
        AdView mAdView = (AdView) findViewById(R.id.adView);
        AdRequest adRequest = new AdRequest.Builder().build();
        mAdView.loadAd(adRequest);
	} else {
        AdView mAdView = (AdView) findViewById(R.id.adView);
   		mAdView.setVisibility(View.GONE);
	}*/
	
	tts = new TextToSpeech(this, this);

	videoView = (VideoView)findViewById(R.id.videoView);
	video1View = videoView;
	video2View = (VideoView)findViewById(R.id.video2View);
	resetVideoErrorListener();
	resetVideoErrorListener2();
	videoError = false;
	
	imageView = (ImageView)findViewById(R.id.imageView);
	image1View = imageView;
	image2View = (ImageView)findViewById(R.id.image2View);
	videoLayout = findViewById(R.id.videoLayout);
	video1Layout = videoLayout;
	video2Layout = findViewById(R.id.video2Layout);

	if (MainActivity.translate) {
		findViewById(R.id.yandex).setVisibility(View.VISIBLE);
	} else {
		findViewById(R.id.yandex).setVisibility(View.GONE);
	}
	
	ListView list = (ListView) findViewById(R.id.chatList);
	list.setAdapter(new ChatListAdapter(this, R.layout.chat_list, this.messages));
	list.setTranscriptMode(ListView.TRANSCRIPT_MODE_ALWAYS_SCROLL);

	HttpGetImageAction.fetchImage(this, instance.avatar, imageView);
	HttpGetImageAction.fetchImage(this, instance.avatar, (ImageView)findViewById(R.id.responseImageView));

	HttpGetImageAction.fetchImage(this, instance2.avatar, (ImageView)findViewById(R.id.image2View));
	
	ChatConfig config = new ChatConfig();
	config.instance = instance.id;
	config.message = StartWarActivity.topic;
	config.avatar = this.avatarId;
	if (MainActivity.translate && MainActivity.voice != null) {
		config.language = MainActivity.voice.language;
	}
	if (MainActivity.disableVideo) {
		config.avatarFormat = "image";
	} else {
		config.avatarFormat = MainActivity.webm ? "webm" : "mp4";
	}
	config.avatarHD = MainActivity.hd;
	config.speak = !MainActivity.deviceVoice;
	HttpAction action = new HttpChatAction(WarActivity.this, config);
	action.execute();
}
 
Example 8
Source File: WarActivity.java    From BotLibre with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
	super.superOnCreate(savedInstanceState);
	setContentView(R.layout.activity_war);

	this.instance = StartWarActivity.bot1;
	this.instance1 = StartWarActivity.bot1;
	this.instance2 = StartWarActivity.bot2;
	if (this.instance == null) {
		return;
	}
	this.count = 0;
	this.currentBot = 0;
	this.conversation1 = null;
	this.conversation2 = null;
	this.finished = false;
	/*if (MainActivity.showAds) {
        AdView mAdView = (AdView) findViewById(R.id.adView);
        AdRequest adRequest = new AdRequest.Builder().build();
        mAdView.loadAd(adRequest);
	} else {
        AdView mAdView = (AdView) findViewById(R.id.adView);
   		mAdView.setVisibility(View.GONE);
	}*/
	
	tts = new TextToSpeech(this, this);

	videoView = (VideoView)findViewById(R.id.videoView);
	video1View = videoView;
	video2View = (VideoView)findViewById(R.id.video2View);
	resetVideoErrorListener();
	resetVideoErrorListener2();
	videoError = false;
	
	imageView = (ImageView)findViewById(R.id.imageView);
	image1View = imageView;
	image2View = (ImageView)findViewById(R.id.image2View);
	videoLayout = findViewById(R.id.videoLayout);
	video1Layout = videoLayout;
	video2Layout = findViewById(R.id.video2Layout);

	if (MainActivity.translate) {
		findViewById(R.id.yandex).setVisibility(View.VISIBLE);
	} else {
		findViewById(R.id.yandex).setVisibility(View.GONE);
	}
	
	ListView list = (ListView) findViewById(R.id.chatList);
	list.setAdapter(new ChatListAdapter(this, R.layout.chat_list, this.messages));
	list.setTranscriptMode(ListView.TRANSCRIPT_MODE_ALWAYS_SCROLL);

	HttpGetImageAction.fetchImage(this, instance.avatar, imageView);
	HttpGetImageAction.fetchImage(this, instance.avatar, (ImageView)findViewById(R.id.responseImageView));

	HttpGetImageAction.fetchImage(this, instance2.avatar, (ImageView)findViewById(R.id.image2View));
	
	ChatConfig config = new ChatConfig();
	config.instance = instance.id;
	config.message = StartWarActivity.topic;
	config.avatar = this.avatarId;
	if (MainActivity.translate && MainActivity.voice != null) {
		config.language = MainActivity.voice.language;
	}
	if (MainActivity.disableVideo) {
		config.avatarFormat = "image";
	} else {
		config.avatarFormat = MainActivity.webm ? "webm" : "mp4";
	}
	config.avatarHD = MainActivity.hd;
	config.speak = !MainActivity.deviceVoice;
	HttpAction action = new HttpChatAction(WarActivity.this, config);
	action.execute();
}
 
Example 9
Source File: BufferFragment.java    From tapchat-android with Apache License 2.0 4 votes vote down vote up
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
       LinearLayout layout = new LinearLayout(getActivity());
       layout.setOrientation(LinearLayout.VERTICAL);
       layout.setLayoutParams(new LayoutParams(MATCH_PARENT, MATCH_PARENT));

        View connectionHeaderView = inflater.inflate(R.layout.connection_header, null);
        layout.addView(connectionHeaderView, new LayoutParams(MATCH_PARENT, WRAP_CONTENT));

        View bufferHeaderView = inflater.inflate(R.layout.fragment_buffer_header, null);
        layout.addView(bufferHeaderView, new LayoutParams(MATCH_PARENT, WRAP_CONTENT));

        ListView listView = new ListView(getActivity());
        listView.setId(android.R.id.list);
        listView.setDivider(null);
        listView.setStackFromBottom(true);
        listView.setTranscriptMode(AbsListView.TRANSCRIPT_MODE_NORMAL);
        listView.setSmoothScrollbarEnabled(false);
//        listView.setCacheColorHint(Color.TRANSPARENT);

        LayoutParams params = new LayoutParams(MATCH_PARENT, 0);
        params.weight = 1;
        layout.addView(listView, params);
        View footerView = inflater.inflate(R.layout.fragment_buffer_footer, null);
        layout.addView(footerView, new LayoutParams(MATCH_PARENT, WRAP_CONTENT));

        ((TextView) footerView.findViewById(R.id.text_entry)).setOnEditorActionListener(new TextView.OnEditorActionListener() {
            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
                if (event != null && event.getAction() != KeyEvent.ACTION_DOWN) {
                    return false;
                }

                sendMessage();
                return true;
            }
        });

        footerView.findViewById(R.id.send_button).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                sendMessage();
            }
        });

        return layout;
    }