Search in sources :

Example 91 with Button

use of android.widget.Button in project grafika by google.

the class PlayMovieSurfaceActivity method updateControls.

/**
     * Updates the on-screen controls to reflect the current state of the app.
     */
private void updateControls() {
    Button play = (Button) findViewById(R.id.play_stop_button);
    if (mShowStopLabel) {
        play.setText(R.string.stop_button_text);
    } else {
        play.setText(R.string.play_button_text);
    }
    play.setEnabled(mSurfaceHolderReady);
}
Also used : Button(android.widget.Button)

Example 92 with Button

use of android.widget.Button in project grafika by google.

the class RecordFBOActivity method updateControls.

/**
     * Updates the on-screen controls to reflect the current state of the app.
     */
private void updateControls() {
    Button toggleRelease = (Button) findViewById(R.id.fboRecord_button);
    int id = mRecordingEnabled ? R.string.toggleRecordingOff : R.string.toggleRecordingOn;
    toggleRelease.setText(id);
    RadioButton rb;
    rb = (RadioButton) findViewById(R.id.recDrawTwice_radio);
    rb.setChecked(mSelectedRecordMethod == RECMETHOD_DRAW_TWICE);
    rb = (RadioButton) findViewById(R.id.recFbo_radio);
    rb.setChecked(mSelectedRecordMethod == RECMETHOD_FBO);
    rb = (RadioButton) findViewById(R.id.recFramebuffer_radio);
    rb.setChecked(mSelectedRecordMethod == RECMETHOD_BLIT_FRAMEBUFFER);
    rb.setEnabled(mBlitFramebufferAllowed);
    TextView tv = (TextView) findViewById(R.id.nowRecording_text);
    if (mRecordingEnabled) {
        tv.setText(getString(R.string.nowRecording));
    } else {
        tv.setText("");
    }
}
Also used : RadioButton(android.widget.RadioButton) Button(android.widget.Button) TextView(android.widget.TextView) RadioButton(android.widget.RadioButton)

Example 93 with Button

use of android.widget.Button in project newsrob by marianokamp.

the class ShowMarketInformationActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    boolean isFreeVersionInstalled = false;
    try {
        isFreeVersionInstalled = (getPackageManager().getPackageInfo("com.newsrob", 0)) != null;
    } catch (Throwable t) {
    //
    }
    setContentView(R.layout.show_market_information);
    findViewById(R.id.all_done).setVisibility(isFreeVersionInstalled ? View.VISIBLE : View.GONE);
    findViewById(R.id.need_to_install_free_version).setVisibility(isFreeVersionInstalled ? View.GONE : View.VISIBLE);
    Button b = (Button) findViewById(R.id.close_button);
    b.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            finish();
        }
    });
}
Also used : Button(android.widget.Button) View(android.view.View)

Example 94 with Button

use of android.widget.Button in project LiveSDK-for-Android by liveservices.

the class ContactsActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.view_contacts);
    ListView lv = getListView();
    lv.setTextFilterEnabled(true);
    lv.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            Contact contact = (Contact) parent.getItemAtPosition(position);
            ViewContactDialog dialog = new ViewContactDialog(ContactsActivity.this, contact);
            dialog.setOwnerActivity(ContactsActivity.this);
            dialog.show();
        }
    });
    LinearLayout layout = new LinearLayout(this);
    Button newCalendarButton = new Button(this);
    newCalendarButton.setText("New Contact");
    newCalendarButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            CreateContactDialog dialog = new CreateContactDialog(ContactsActivity.this);
            dialog.setOwnerActivity(ContactsActivity.this);
            dialog.show();
        }
    });
    layout.addView(newCalendarButton);
    lv.addHeaderView(layout);
    mAdapter = new ContactsListAdapter(this);
    setListAdapter(mAdapter);
    LiveSdkSampleApplication app = (LiveSdkSampleApplication) getApplication();
    mClient = app.getConnectClient();
}
Also used : OnItemClickListener(android.widget.AdapterView.OnItemClickListener) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) ListView(android.widget.ListView) ListView(android.widget.ListView) Button(android.widget.Button) OnClickListener(android.view.View.OnClickListener) LiveSdkSampleApplication(com.microsoft.live.sample.LiveSdkSampleApplication) LinearLayout(android.widget.LinearLayout)

Example 95 with Button

use of android.widget.Button in project LiveSDK-for-Android by liveservices.

the class SkyDriveActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.skydrive);
    mPrevFolderIds = new Stack<String>();
    ListView lv = getListView();
    lv.setTextFilterEnabled(true);
    lv.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            SkyDriveObject skyDriveObj = (SkyDriveObject) parent.getItemAtPosition(position);
            skyDriveObj.accept(new Visitor() {

                @Override
                public void visit(SkyDriveAlbum album) {
                    mPrevFolderIds.push(mCurrentFolderId);
                    loadFolder(album.getId());
                }

                @Override
                public void visit(SkyDrivePhoto photo) {
                    ViewPhotoDialog dialog = new ViewPhotoDialog(SkyDriveActivity.this, photo);
                    dialog.setOwnerActivity(SkyDriveActivity.this);
                    dialog.show();
                }

                @Override
                public void visit(SkyDriveFolder folder) {
                    mPrevFolderIds.push(mCurrentFolderId);
                    loadFolder(folder.getId());
                }

                @Override
                public void visit(SkyDriveFile file) {
                    Bundle b = new Bundle();
                    b.putString(JsonKeys.ID, file.getId());
                    b.putString(JsonKeys.NAME, file.getName());
                    showDialog(DIALOG_DOWNLOAD_ID, b);
                }

                @Override
                public void visit(SkyDriveVideo video) {
                    PlayVideoDialog dialog = new PlayVideoDialog(SkyDriveActivity.this, video);
                    dialog.setOwnerActivity(SkyDriveActivity.this);
                    dialog.show();
                }

                @Override
                public void visit(SkyDriveAudio audio) {
                    PlayAudioDialog audioDialog = new PlayAudioDialog(SkyDriveActivity.this, audio);
                    audioDialog.show();
                }
            });
        }
    });
    LinearLayout layout = new LinearLayout(this);
    Button newFolderButton = new Button(this);
    newFolderButton.setText("New Folder");
    newFolderButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            NewFolderDialog dialog = new NewFolderDialog(SkyDriveActivity.this);
            dialog.setOwnerActivity(SkyDriveActivity.this);
            dialog.show();
        }
    });
    layout.addView(newFolderButton);
    Button uploadFileButton = new Button(this);
    uploadFileButton.setText("Upload File");
    uploadFileButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            Intent intent = new Intent(getApplicationContext(), FilePicker.class);
            startActivityForResult(intent, FilePicker.PICK_FILE_REQUEST);
        }
    });
    layout.addView(uploadFileButton);
    lv.addHeaderView(layout);
    mPhotoAdapter = new SkyDriveListAdapter(this);
    setListAdapter(mPhotoAdapter);
    LiveSdkSampleApplication app = (LiveSdkSampleApplication) getApplication();
    mClient = app.getConnectClient();
}
Also used : Visitor(com.microsoft.live.sample.skydrive.SkyDriveObject.Visitor) ListView(android.widget.ListView) Button(android.widget.Button) LiveSdkSampleApplication(com.microsoft.live.sample.LiveSdkSampleApplication) OnItemClickListener(android.widget.AdapterView.OnItemClickListener) Bundle(android.os.Bundle) Intent(android.content.Intent) ImageView(android.widget.ImageView) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) ListView(android.widget.ListView) VideoView(android.widget.VideoView) OnClickListener(android.view.View.OnClickListener) LinearLayout(android.widget.LinearLayout) FilePicker(com.microsoft.live.sample.util.FilePicker)

Aggregations

Button (android.widget.Button)1477 View (android.view.View)909 TextView (android.widget.TextView)609 OnClickListener (android.view.View.OnClickListener)275 Intent (android.content.Intent)200 LinearLayout (android.widget.LinearLayout)189 ImageView (android.widget.ImageView)146 EditText (android.widget.EditText)126 ListView (android.widget.ListView)112 AdapterView (android.widget.AdapterView)76 ViewGroup (android.view.ViewGroup)65 LayoutInflater (android.view.LayoutInflater)56 CompoundButton (android.widget.CompoundButton)53 ScrollView (android.widget.ScrollView)53 Test (org.junit.Test)51 Bundle (android.os.Bundle)49 CheckBox (android.widget.CheckBox)48 FrameLayout (android.widget.FrameLayout)47 AlertDialog (android.app.AlertDialog)45 ImageButton (android.widget.ImageButton)45