AddChannelActivity: missing dependencies

This commit is contained in:
Sebastian Kaspari 2010-04-25 10:19:59 +02:00
parent 034617efc3
commit b54e92c1e2
2 changed files with 22 additions and 1 deletions

View File

@ -127,6 +127,20 @@ along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
android:layout_height="wrap_content"
android:text=""
android:singleLine="true" />
<TextView
android:text="Channels"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#ff333333"
android:textSize="14px"
android:gravity="center_horizontal"
android:padding="3px"
android:layout_margin="2px" />
<Button
android:id="@+id/channels"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Channels" />
<TextView
android:text="Preferences"
android:layout_width="fill_parent"
@ -148,7 +162,8 @@ along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:paddingTop="10px">
<Button
android:id="@+id/add"
android:text="@string/add_server"

View File

@ -24,6 +24,7 @@ import java.io.UnsupportedEncodingException;
import java.util.regex.Pattern;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
@ -72,6 +73,8 @@ public class AddServerActivity extends Activity implements OnClickListener
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(adapter);
((Button) findViewById(R.id.channels)).setOnClickListener(this);
Bundle extras = getIntent().getExtras();
if (extras != null && extras.containsKey(Extra.SERVER)) {
// Request to edit an existing server
@ -120,6 +123,9 @@ public class AddServerActivity extends Activity implements OnClickListener
public void onClick(View v)
{
switch (v.getId()) {
case R.id.channels:
startActivityForResult(new Intent(this, AddChannelActivity.class), 0);
break;
case R.id.add:
try {
validateServer();