Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Unified Diff: webrtc/examples/androidapp/src/org/appspot/apprtc/ConnectActivity.java

Issue 2003983002: UI for AppRTC Android demo that doesn't require Design Support Library (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/examples/androidapp/res/menu/connect_menu.xml ('k') | webrtc/webrtc_examples.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/examples/androidapp/src/org/appspot/apprtc/ConnectActivity.java
diff --git a/webrtc/examples/androidapp/src/org/appspot/apprtc/ConnectActivity.java b/webrtc/examples/androidapp/src/org/appspot/apprtc/ConnectActivity.java
index b0bceccff46dae04c43a6247fdc4163ce1e7d8db..8e9de65b5ce08d5164eb1f04c9ec8347ee90030e 100644
--- a/webrtc/examples/androidapp/src/org/appspot/apprtc/ConnectActivity.java
+++ b/webrtc/examples/androidapp/src/org/appspot/apprtc/ConnectActivity.java
@@ -10,19 +10,17 @@
package org.appspot.apprtc;
+import android.app.Activity;
+import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle;
import android.preference.PreferenceManager;
-import android.support.design.widget.FloatingActionButton;
-import android.support.v7.app.AlertDialog;
-import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.ContextMenu;
import android.view.KeyEvent;
-import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
@@ -45,14 +43,14 @@ import java.util.Random;
/**
* Handles the initial setup where the user selects which room to join.
*/
-public class ConnectActivity extends AppCompatActivity {
+public class ConnectActivity extends Activity {
private static final String TAG = "ConnectActivity";
private static final int CONNECTION_REQUEST = 1;
private static final int REMOVE_FAVORITE_INDEX = 0;
private static boolean commandLineRun = false;
private ImageButton connectButton;
- private FloatingActionButton addFavoriteButton;
+ private ImageButton addFavoriteButton;
private EditText roomEditText;
private ListView roomListView;
private SharedPreferences sharedPref;
@@ -130,6 +128,8 @@ public class ConnectActivity extends AppCompatActivity {
registerForContextMenu(roomListView);
connectButton = (ImageButton) findViewById(R.id.connect_button);
connectButton.setOnClickListener(connectListener);
+ addFavoriteButton = (ImageButton) findViewById(R.id.add_favorite_button);
+ addFavoriteButton.setOnClickListener(addFavoriteListener);
// If an implicit VIEW intent is launching the app, go directly to that URL.
final Intent intent = getIntent();
@@ -143,9 +143,6 @@ public class ConnectActivity extends AppCompatActivity {
connectToRoom(room, true, loopback, runTimeMs);
return;
}
-
- addFavoriteButton = (FloatingActionButton) findViewById(R.id.add_favorite_button);
- addFavoriteButton.setOnClickListener(addFavoriteListener);
}
@Override
@@ -414,27 +411,11 @@ public class ConnectActivity extends AppCompatActivity {
private final OnClickListener addFavoriteListener = new OnClickListener() {
@Override
public void onClick(View view) {
- AlertDialog.Builder builder = new AlertDialog.Builder(ConnectActivity.this);
-
- final View dialogView = LayoutInflater.from(ConnectActivity.this)
- .inflate(R.layout.dialog_add_favorite, null);
- final EditText favoriteEditText = (EditText) dialogView.findViewById(R.id.favorite_edittext);
- favoriteEditText.append(roomEditText.getText());
-
- builder.setTitle(R.string.add_favorite_title)
- .setPositiveButton(R.string.add, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialogInterface, int i) {
- String newRoom = favoriteEditText.getText().toString();
- if (newRoom.length() > 0 && !roomList.contains(newRoom)) {
- adapter.add(newRoom);
- adapter.notifyDataSetChanged();
- }
- }
- })
- .setView(dialogView)
- .setNegativeButton(R.string.cancel, null);
- builder.show();
+ String newRoom = roomEditText.getText().toString();
+ if (newRoom.length() > 0 && !roomList.contains(newRoom)) {
+ adapter.add(newRoom);
+ adapter.notifyDataSetChanged();
+ }
}
};
« no previous file with comments | « webrtc/examples/androidapp/res/menu/connect_menu.xml ('k') | webrtc/webrtc_examples.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698