Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apapun #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
android:name=".ViewSchedule"
android:label="@string/title_activity_view_schedule" >
</activity>
<activity
android:name=".TabHostSchedule"
android:label="@string/title_activity_tab_host_schedule" >
</activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ public View getView(int position, View convertView,ViewGroup parent){
View theView = theInflater.inflate(R.layout.activity_view_schedule, parent, false);
String places = getItem(position);

TextView theTextView = (TextView) theView.findViewById(R.id.textView1);
TextView theTextView = (TextView) theView.findViewById(R.id.Placename);

theTextView.setText(places);

ImageView theImageView =(ImageView) theView.findViewById(R.id.imageView1);
ImageView theImageView =(ImageView) theView.findViewById(R.id.weatherlogo);
theImageView.setImageResource(logos[position]);
return theView;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package com.example.android.cz2006androidproject;

import android.app.TabActivity;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TabHost;

public class TabHostSchedule extends TabActivity {
TabHost tabHost;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_tab_host_schedule);
tabHost = getTabHost();

TabHost.TabSpec ts1 = tabHost.newTabSpec("page1");
ts1.setIndicator("List View");
ts1.setContent(new Intent(this, displayListView.class));
tabHost.addTab(ts1);
TabHost.TabSpec ts2 = tabHost.newTabSpec("page2");
ts2.setIndicator("ETC");
ts2.setContent(new Intent(this, calendar.class));
tabHost.addTab(ts2);

}

@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_tab_host_schedule, 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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,19 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_calendar);
cal = (CalendarView) findViewById(R.id.calendar);
cal.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {

}
});

cal.setOnDateChangeListener(new CalendarView.OnDateChangeListener() {

@Override
public void onSelectedDayChange(CalendarView view, int year, int month, int dayOfMonth) {
Toast.makeText(getApplicationContext(), dayOfMonth + "/" + (month+1) + "/" + year, Toast.LENGTH_LONG).show();

}
});
}
Expand Down Expand Up @@ -62,7 +70,7 @@ public void homePageClicked(View view) {

//Move to SearchPage
public void searchPageClicked(View view) {
Intent intent = new Intent(calendar.this, search.class);
Intent intent = new Intent(calendar.this, TabHostSchedule.class);
startActivity(intent);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ protected void onCreate(Bundle savedInstanceState) {
theListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
String Placekicked ="Detail" +
String Placepicked ="Detail" +
String.valueOf(adapterView.getItemAtPosition(position));

Toast.makeText(displayListView.this, Placekicked, Toast.LENGTH_SHORT).show();
Toast.makeText(displayListView.this, Placepicked, Toast.LENGTH_SHORT).show();

}
});
Expand Down
37 changes: 37 additions & 0 deletions app/src/main/res/layout/activity_tab_host_schedule.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<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="com.example.android.cz2006androidproject.TabHostSchedule">

<TabHost
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/tabHost"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<TabWidget
android:id="@android:id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"></TabWidget>

<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="match_parent">



</FrameLayout>
</LinearLayout>
</TabHost>
</RelativeLayout>
6 changes: 3 additions & 3 deletions app/src/main/res/layout/activity_view_schedule.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
tools:context="com.example.windows7.schedule.MainActivity">
tools:context="com.example.android.cz2006androidproject.displayListView">
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="25dp"
android:id ="@+id/imageView1"/>
android:id ="@+id/weatherlogo"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id ="@+id/textView1"
android:id ="@+id/Placename"
android:textSize ="30sp"
android:textStyle="bold"
android:padding="15dp"/>
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/res/menu/menu_tab_host_schedule.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.example.android.cz2006androidproject.TabHostSchedule">
<item android:id="@+id/action_settings" android:title="@string/action_settings"
android:orderInCategory="100" app:showAsAction="never" />
</menu>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
<string name="action_settings">Settings</string>
<string name="title_activity_calendar">calendar</string>
<string name="title_activity_view_schedule">ViewSchedule</string>
<string name="title_activity_tab_host_schedule">TabHostSchedule</string>
</resources>