drpost / Androidchequedeposit

Centennial College Student project - Android cheque deposit 3 tier
1 stars 1 forks source link

Build Help Screen #43

Closed drpost closed 9 years ago

YaowenB commented 9 years ago

package com.example.ban.comp231_project;

import android.support.v7.app.ActionBarActivity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.widget.ArrayAdapter; import android.widget.ListView;

public class HelpScreen extends ActionBarActivity { ListView HelpListView;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_help_screen);
    HelpListView=(ListView)findViewById(R.id.HelpListView);
    String[] values=new String[]{"Step by Step","Selecting Account","Taking Pictures"
    ,"About the Process"};
    ArrayAdapter<String> adapter=new ArrayAdapter<String>(this,
            android.R.layout.simple_list_item_1, android.R.id.text1,values);

    HelpListView.setAdapter(adapter);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.menu_help_screen, menu);
    return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();

    //noinspection SimplifiableIfStatement
    if (id == R.id.action_settings) {
        return true;
    }

    return super.onOptionsItemSelected(item);
}

}

YaowenB commented 9 years ago

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".HelpScreen">

<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/Language"
    android:id="@+id/button" />

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/HelpTitle"
    android:id="@+id/HelpTextView"
    android:layout_below="@+id/button"
    android:layout_centerHorizontal="true"
    android:textSize="25dp"/>

<ListView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/HelpListView"
    android:layout_below="@+id/HelpTextView"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"

    />