Search in sources :

Example 1 with ScrollingMovementMethod

use of android.text.method.ScrollingMovementMethod in project android by owncloud.

the class GenericExplanationActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Intent intent = getIntent();
    String message = intent.getStringExtra(MESSAGE);
    ArrayList<String> list = intent.getStringArrayListExtra(EXTRA_LIST);
    ArrayList<String> list2 = intent.getStringArrayListExtra(EXTRA_LIST_2);
    setContentView(R.layout.generic_explanation);
    if (message != null) {
        TextView textView = (TextView) findViewById(R.id.message);
        textView.setText(message);
        textView.setMovementMethod(new ScrollingMovementMethod());
    }
    ListView listView = (ListView) findViewById(R.id.list);
    if (list != null && list.size() > 0) {
        //ListAdapter adapter = new ArrayAdapter<String>(this,
        // android.R.layout.simple_list_item_1, list);
        ListAdapter adapter = new ExplanationListAdapterView(this, list, list2);
        listView.setAdapter(adapter);
    } else {
        listView.setVisibility(View.GONE);
    }
}
Also used : ListView(android.widget.ListView) Intent(android.content.Intent) TextView(android.widget.TextView) ScrollingMovementMethod(android.text.method.ScrollingMovementMethod) ListAdapter(android.widget.ListAdapter)

Example 2 with ScrollingMovementMethod

use of android.text.method.ScrollingMovementMethod in project platform_frameworks_base by android.

the class SoundTriggerTestActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    // Make sure that this activity can punch through the lockscreen if needed.
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    mDebugView = (TextView) findViewById(R.id.console);
    mScrollView = (ScrollView) findViewById(R.id.scroller_id);
    mRadioGroup = (RadioGroup) findViewById(R.id.model_group_id);
    mPlayTriggerButton = (Button) findViewById(R.id.play_trigger_id);
    mDebugView.setText(mDebugView.getText(), TextView.BufferType.EDITABLE);
    mDebugView.setMovementMethod(new ScrollingMovementMethod());
    mCaptureAudioCheckBox = (CheckBox) findViewById(R.id.caputre_check_box);
    mPlayCapturedAudioButton = (Button) findViewById(R.id.play_captured_id);
    mHandler = new Handler();
    mButtonModelUuidMap = new HashMap();
    mModelButtons = new HashMap();
    mModelNames = new HashMap();
    mModelRadioButtons = new LinkedList();
    setVolumeControlStream(AudioManager.STREAM_MUSIC);
    // Make sure that the service is started, so even if our activity goes down, we'll still
    // have a request for it to run.
    startService(new Intent(getBaseContext(), SoundTriggerTestService.class));
    // Bind to SoundTriggerTestService.
    Intent intent = new Intent(this, SoundTriggerTestService.class);
    bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
}
Also used : HashMap(java.util.HashMap) Handler(android.os.Handler) Intent(android.content.Intent) ScrollingMovementMethod(android.text.method.ScrollingMovementMethod) LinkedList(java.util.LinkedList)

Example 3 with ScrollingMovementMethod

use of android.text.method.ScrollingMovementMethod in project grpc-java by grpc.

the class HelloworldActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_helloworld);
    mSendButton = (Button) findViewById(R.id.send_button);
    mHostEdit = (EditText) findViewById(R.id.host_edit_text);
    mPortEdit = (EditText) findViewById(R.id.port_edit_text);
    mMessageEdit = (EditText) findViewById(R.id.message_edit_text);
    mResultText = (TextView) findViewById(R.id.grpc_response_text);
    mResultText.setMovementMethod(new ScrollingMovementMethod());
}
Also used : ScrollingMovementMethod(android.text.method.ScrollingMovementMethod)

Example 4 with ScrollingMovementMethod

use of android.text.method.ScrollingMovementMethod in project android_frameworks_base by DirtyUnicorns.

the class SoundTriggerTestActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    // Make sure that this activity can punch through the lockscreen if needed.
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    mDebugView = (TextView) findViewById(R.id.console);
    mScrollView = (ScrollView) findViewById(R.id.scroller_id);
    mRadioGroup = (RadioGroup) findViewById(R.id.model_group_id);
    mPlayTriggerButton = (Button) findViewById(R.id.play_trigger_id);
    mDebugView.setText(mDebugView.getText(), TextView.BufferType.EDITABLE);
    mDebugView.setMovementMethod(new ScrollingMovementMethod());
    mCaptureAudioCheckBox = (CheckBox) findViewById(R.id.caputre_check_box);
    mPlayCapturedAudioButton = (Button) findViewById(R.id.play_captured_id);
    mHandler = new Handler();
    mButtonModelUuidMap = new HashMap();
    mModelButtons = new HashMap();
    mModelNames = new HashMap();
    mModelRadioButtons = new LinkedList();
    setVolumeControlStream(AudioManager.STREAM_MUSIC);
    // Make sure that the service is started, so even if our activity goes down, we'll still
    // have a request for it to run.
    startService(new Intent(getBaseContext(), SoundTriggerTestService.class));
    // Bind to SoundTriggerTestService.
    Intent intent = new Intent(this, SoundTriggerTestService.class);
    bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
}
Also used : HashMap(java.util.HashMap) Handler(android.os.Handler) Intent(android.content.Intent) ScrollingMovementMethod(android.text.method.ScrollingMovementMethod) LinkedList(java.util.LinkedList)

Example 5 with ScrollingMovementMethod

use of android.text.method.ScrollingMovementMethod in project android_frameworks_base by ResurrectionRemix.

the class SoundTriggerTestActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    // Make sure that this activity can punch through the lockscreen if needed.
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    mDebugView = (TextView) findViewById(R.id.console);
    mScrollView = (ScrollView) findViewById(R.id.scroller_id);
    mRadioGroup = (RadioGroup) findViewById(R.id.model_group_id);
    mPlayTriggerButton = (Button) findViewById(R.id.play_trigger_id);
    mDebugView.setText(mDebugView.getText(), TextView.BufferType.EDITABLE);
    mDebugView.setMovementMethod(new ScrollingMovementMethod());
    mCaptureAudioCheckBox = (CheckBox) findViewById(R.id.caputre_check_box);
    mPlayCapturedAudioButton = (Button) findViewById(R.id.play_captured_id);
    mHandler = new Handler();
    mButtonModelUuidMap = new HashMap();
    mModelButtons = new HashMap();
    mModelNames = new HashMap();
    mModelRadioButtons = new LinkedList();
    setVolumeControlStream(AudioManager.STREAM_MUSIC);
    // Make sure that the service is started, so even if our activity goes down, we'll still
    // have a request for it to run.
    startService(new Intent(getBaseContext(), SoundTriggerTestService.class));
    // Bind to SoundTriggerTestService.
    Intent intent = new Intent(this, SoundTriggerTestService.class);
    bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
}
Also used : HashMap(java.util.HashMap) Handler(android.os.Handler) Intent(android.content.Intent) ScrollingMovementMethod(android.text.method.ScrollingMovementMethod) LinkedList(java.util.LinkedList)

Aggregations

ScrollingMovementMethod (android.text.method.ScrollingMovementMethod)9 Intent (android.content.Intent)6 Handler (android.os.Handler)5 HashMap (java.util.HashMap)4 LinkedList (java.util.LinkedList)4 TextView (android.widget.TextView)3 ListView (android.widget.ListView)2 SuppressLint (android.annotation.SuppressLint)1 Point (android.graphics.Point)1 Button (android.widget.Button)1 ListAdapter (android.widget.ListAdapter)1 JsonArray (com.google.gson.JsonArray)1 JsonElement (com.google.gson.JsonElement)1 JsonObject (com.google.gson.JsonObject)1 FileDataStorageManager (com.owncloud.android.datamodel.FileDataStorageManager)1 ArrayList (java.util.ArrayList)1