Skip to content

Commit aee4baa

Browse files
Added gen_toolbar,Collapsedtoolbar and footer
1 parent 53d143f commit aee4baa

16 files changed

Lines changed: 763 additions & 223 deletions

app/src/main/AndroidManifest.xml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,20 @@
88
android:label="@string/app_name"
99
android:roundIcon="@mipmap/ic_launcher_round"
1010
android:supportsRtl="true"
11-
android:theme="@style/AppTheme">
12-
<activity android:name=".SplashScreen">
11+
android:theme="@style/AppTheme"
12+
13+
>
14+
<activity android:name=".SplashScreen" android:noHistory="true" android:screenOrientation="portrait">
1315
<intent-filter>
1416
<action android:name="android.intent.action.MAIN" />
1517

1618
<category android:name="android.intent.category.LAUNCHER" />
19+
1720
</intent-filter>
1821
</activity>
19-
<activity android:name=".ListPage" />
20-
<activity android:name=".HomeScreen" />
21-
<activity android:name=".DescriptionActivity"></activity>
22+
<activity android:name=".ListPage" android:screenOrientation="portrait"/>
23+
<activity android:name=".HomeScreen" android:screenOrientation="portrait"/>
24+
<activity android:name=".DescriptionActivity" android:screenOrientation="portrait"></activity>
2225
</application>
2326

2427
</manifest>

app/src/main/java/com/example/androidtechies/majorproject/DescriptionActivity.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import android.os.Bundle;
55
import android.support.design.widget.CollapsingToolbarLayout;
66
import android.support.v7.app.AppCompatActivity;
7+
import android.support.v7.widget.Toolbar;
78
import android.util.Log;
89
import android.widget.TextView;
910

@@ -36,8 +37,11 @@ protected void onCreate(Bundle savedInstanceState) {
3637
String module = model.getModulein();
3738
Log.d("Information", title+ " 2 "+intro+ " 3 "+tech);
3839
introDescription.setText(intro);
40+
introDescription.setTextSize(20f);
3941
techDescription.setText(tech);
42+
techDescription.setTextSize(20f);
4043
modulein.setText(module);
44+
modulein.setTextSize(20f);
4145
cToolBar.setTitle(title);
4246

4347

app/src/main/java/com/example/androidtechies/majorproject/HomeScreen.java

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import android.content.Intent;
44
import android.support.v7.app.AppCompatActivity;
55
import android.os.Bundle;
6+
import android.support.v7.widget.Toolbar;
67
import android.view.View;
78
import android.widget.Button;
89

@@ -11,21 +12,26 @@
1112

1213
public class HomeScreen extends AppCompatActivity {
1314
public static final String HomeScreenTag = "HomeScreen";
14-
public static final Integer cseValue = 0;
15-
public static final Integer itValue = 1;
16-
public static final Integer eceValue = 2;
17-
public static final Integer eeeValue = 3;
15+
public static final Integer cseValue = 1;
16+
public static final Integer itValue = 0;
17+
// public static final Integer eceValue = 2;
18+
// public static final Integer eeeValue = 3;
1819
AppDatabase appDatabase;
20+
Toolbar homeToolbar;
1921

2022

2123
@Override
2224
protected void onCreate(Bundle savedInstanceState) {
2325
super.onCreate(savedInstanceState);
2426
setContentView(R.layout.activity_home_screen);
25-
final Button cse = (Button) findViewById(R.id.cseTag);
26-
Button ece = (Button) findViewById(R.id.eceTag);
27+
28+
homeToolbar = findViewById(R.id.hometToolbar);
29+
homeToolbar.setTitle("Select Branch");
30+
31+
Button cse = (Button) findViewById(R.id.cseTag);
32+
// Button ece = (Button) findViewById(R.id.eceTag);
2733
Button it = (Button) findViewById(R.id.itTag);
28-
Button eee = (Button) findViewById(R.id.eeeTag);
34+
// Button eee = (Button) findViewById(R.id.eeeTag);
2935
cse.setOnClickListener(new View.OnClickListener() {
3036
@Override
3137
public void onClick(View view) {
@@ -42,30 +48,30 @@ public void onClick(View view) {
4248
// Intent eceIntent = new Intent(HomeScreen.this, ListPage.class);
4349
// eceIntent.putExtra(HomeScreenTag, eceValue);
4450
// startActivity(eceIntent);
45-
51+
//
4652
//
4753
// }
4854
// });
49-
// it.setOnClickListener(new View.OnClickListener() {
50-
// @Override
51-
// public void onClick(View view) {
55+
it.setOnClickListener(new View.OnClickListener() {
56+
@Override
57+
public void onClick(View view) {
5258

53-
// Intent itIntent = new Intent(HomeScreen.this, ListPage.class);
54-
//
55-
// itIntent.putExtra(HomeScreenTag, itValue);
56-
// startActivity(itIntent);
59+
Intent itIntent = new Intent(HomeScreen.this, ListPage.class);
5760

58-
//
59-
// }
60-
// });
61+
itIntent.putExtra(HomeScreenTag, itValue);
62+
startActivity(itIntent);
63+
64+
65+
}
66+
});
6167
// eee.setOnClickListener(new View.OnClickListener() {
6268
// @Override
6369
// public void onClick(View view) {
64-
70+
//
6571
// Intent eeeIntent = new Intent(HomeScreen.this, ListPage.class);
6672
// eeeIntent.putExtra(HomeScreenTag,eeeValue);
6773
// startActivity(eeeIntent);
68-
74+
//
6975
//
7076
// }
7177
// });

app/src/main/java/com/example/androidtechies/majorproject/ListPage.java

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
import android.support.v7.widget.LinearLayoutManager;
88
import android.support.v7.widget.RecyclerView;
99

10+
import android.support.v7.widget.Toolbar;
1011
import android.util.Log;
1112
import android.view.View;
1213

1314
import java.util.ArrayList;
15+
import java.util.List;
1416

1517
public class ListPage extends AppCompatActivity {
1618
ArrayList<InformationModel> informationModelArrayList;
@@ -20,8 +22,9 @@ public class ListPage extends AppCompatActivity {
2022
protected void onCreate(Bundle savedInstanceState) {
2123
super.onCreate(savedInstanceState);
2224
setContentView(R.layout.activity_list_page);
25+
2326
Intent intent = getIntent();
24-
Integer value = intent.getIntExtra(HomeScreen.HomeScreenTag,0);
27+
Integer value = intent.getIntExtra(HomeScreen.HomeScreenTag,1);
2528
informationModelArrayList = new ArrayList<>();
2629
informationModelArrayList = createFakeData(value);
2730

@@ -49,14 +52,15 @@ public void onItemClick(View v, int position) {
4952

5053
private ArrayList<InformationModel> createFakeData(int value) {
5154
ArrayList<InformationModel> arrayList = new ArrayList<>();
52-
55+
Toolbar toolbar = findViewById(R.id.listtoolbar);
5356
InformationModel model;
5457
int length;
5558
switch (value){
5659
/**
5760
* Display content of Information Technology
5861
*/
5962
case 0:
63+
toolbar.setTitle("IT-Select Project");
6064
length = getResources().getStringArray(R.array.project_title_it).length;
6165

6266
for(int i=0 ; i<length; i++) {
@@ -70,25 +74,26 @@ private ArrayList<InformationModel> createFakeData(int value) {
7074
}
7175
break;
7276
/**
73-
* Display content of Computer Science
77+
* Display content of Computer Science Engineering
7478
*/
7579
case 1:
76-
// length = getResources().getStringArray(R.array.project_title_cse).length;
77-
//
78-
// for(int i=0 ; i<length; i++) {
79-
// model = new InformationModel(
80-
// getResources().getStringArray(R.array.project_title_cse)[i],
81-
// getResources().getStringArray(R.array.project_introduction_cse)[i],
82-
// getResources().getStringArray(R.array.project_technology_used_cse)[i],
83-
// getResources().getStringArray(R.array.project_module_cse)[i]
84-
// );
85-
// arrayList.add(model);
86-
// }
80+
toolbar.setTitle("CSE-Select Project");
81+
length = getResources().getStringArray(R.array.project_title_it).length;
82+
for(int i=0 ; i<length; i++) {
83+
model = new InformationModel(
84+
getResources().getStringArray(R.array.project_title_it)[i],
85+
getResources().getStringArray(R.array.project_introduction_it)[i],
86+
getResources().getStringArray(R.array.project_technology_used_it)[i],
87+
getResources().getStringArray(R.array.project_module_it)[i]
88+
);
89+
arrayList.add(model);
90+
}
8791
break;
8892
/**
8993
* Display content of Electronic
9094
*/
9195
case 2:
96+
// toolbar.setTitle("ECE-Select Project");
9297
// length = getResources().getStringArray(R.array.project_title_ece).length;
9398
//
9499
// for(int i=0 ; i<length; i++) {
@@ -104,6 +109,7 @@ private ArrayList<InformationModel> createFakeData(int value) {
104109
* Display content of Information Technology
105110
*/
106111
case 3:
112+
// toolbar.setTitle("EEE-Select Project");
107113
// length = getResources().getStringArray(R.array.project_title_eee).length;
108114
//
109115
// for(int i=0 ; i<length; i++) {
@@ -121,4 +127,5 @@ private ArrayList<InformationModel> createFakeData(int value) {
121127
}
122128
return arrayList;
123129
}
130+
124131
}

app/src/main/java/com/example/androidtechies/majorproject/SplashScreen.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,12 @@ protected void onCreate(Bundle savedInstanceState) {
1919
setContentView(R.layout.activity_main);
2020
textView=(TextView) findViewById(R.id.projectName);
2121
imageView=(ImageView) findViewById(R.id.splashIcon);
22-
Animation myanim = AnimationUtils.loadAnimation(this,R.anim.mytransition);
23-
textView.startAnimation(myanim);
24-
imageView.startAnimation(myanim);
2522
Handler splash = new Handler();
2623
splash.postDelayed(new Runnable() {
2724
@Override
2825
public void run() {
2926
Intent branch = new Intent(SplashScreen.this,HomeScreen.class);
27+
startActivity(branch);
3028
}
3129
},1000);
3230
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<shape xmlns:android="http://schemas.android.com/apk/res/android">
3+
<corners android:radius="100dp"/>
4+
<stroke
5+
android:width="3dp"
6+
android:color="@color/black"
7+
/>
8+
<solid android:color="@color/icons"/>
9+
</shape>

app/src/main/res/layout/activity_home_screen.xml

Lines changed: 62 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,73 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:app="http://schemas.android.com/apk/res-auto"
43
xmlns:tools="http://schemas.android.com/tools"
54
android:layout_width="match_parent"
65
android:layout_height="match_parent"
7-
android:background="@color/colorPrimary"
8-
6+
android:orientation="vertical"
97
tools:context="com.example.androidtechies.majorproject.HomeScreen">
108

11-
<Button
12-
android:id="@+id/cseTag"
13-
android:layout_width="110dp"
14-
android:layout_height="110dp"
15-
16-
android:text="cse"
17-
android:layout_marginLeft="50dp"
18-
android:layout_marginTop="200dp"
19-
android:background="@color/colorPrimaryDark"
20-
21-
android:rotation="-45"
22-
android:textSize="20sp"/>
23-
<Button
24-
android:id="@+id/eceTag"
25-
android:layout_width="110dp"
26-
android:layout_height="110dp"
27-
android:layout_marginLeft="140dp"
28-
android:layout_marginTop="110dp"
29-
30-
android:text="ece"
31-
android:background="@color/colorPrimaryDark"
32-
33-
android:rotation="-45"
34-
android:textSize="20sp"/>
35-
<Button
36-
android:id="@+id/itTag"
37-
android:layout_width="110dp"
38-
android:layout_height="110dp"
39-
40-
android:text="it"
41-
android:background="@color/colorPrimaryDark"
42-
43-
android:layout_marginLeft="230dp"
44-
android:layout_marginTop="200dp"
45-
android:rotation="-45"
9+
<include layout="@layout/general_toolbar"
10+
android:id="@+id/hometToolbar"/>
11+
<LinearLayout
12+
android:layout_width="match_parent"
13+
android:layout_height="match_parent"
14+
android:orientation="vertical"
15+
android:gravity="center_vertical">
16+
<Button
17+
android:id="@+id/cseTag"
18+
android:layout_width="match_parent"
19+
android:layout_height="wrap_content"
20+
android:layout_marginLeft="20dp"
21+
android:layout_marginRight="20dp"
22+
android:background="@drawable/round_corner"
23+
android:layout_marginBottom="16dp"
24+
android:text="@string/cse"
25+
android:textSize="20sp" />
26+
27+
<!--<Button-->
28+
<!--android:id="@+id/eceTag"-->
29+
<!--android:layout_width="match_parent"-->
30+
<!--android:layout_height="wrap_content"-->
31+
<!--android:layout_marginLeft="20dp"-->
32+
<!--android:layout_marginRight="20dp"-->
33+
<!--android:layout_marginBottom="16dp"-->
34+
<!--android:background="@drawable/round_corner"-->
35+
36+
<!--android:text="ece"-->
37+
<!--android:textSize="20sp" />-->
38+
39+
<Button
40+
android:id="@+id/itTag"
41+
android:layout_width="match_parent"
42+
android:layout_height="wrap_content"
43+
android:layout_marginLeft="20dp"
44+
android:layout_marginRight="20dp"
45+
android:layout_marginBottom="16dp"
46+
android:background="@drawable/round_corner"
47+
android:text="@string/it"
48+
android:textSize="20sp" />
49+
50+
<!--<Button-->
51+
<!--android:id="@+id/eeeTag"-->
52+
<!--android:layout_width="match_parent"-->
53+
<!--android:layout_height="wrap_content"-->
54+
<!--android:layout_marginLeft="20dp"-->
55+
<!--android:layout_marginRight="20dp"-->
56+
<!--android:layout_marginBottom="16dp"-->
57+
<!--android:background="@drawable/round_corner"-->
58+
<!--android:text="eee"-->
59+
<!--android:textSize="20sp" />-->
60+
61+
</LinearLayout>
62+
<!--Footer for the app-->
63+
<TextView
64+
android:layout_width="match_parent"
65+
android:layout_height="wrap_content"
66+
android:layout_alignParentBottom="true"
67+
android:text="@string/footer"
68+
android:textColor="@color/black"
69+
android:background="@color/colorPrimary"
4670
android:textSize="20sp"/>
47-
<Button
48-
android:id="@+id/eeeTag"
49-
android:layout_width="110dp"
50-
51-
android:text="eee"
52-
android:background="@color/colorPrimaryDark"
53-
54-
android:layout_height="110dp"
55-
android:layout_marginLeft="140dp"
56-
android:layout_marginTop="290dp"
57-
android:rotation="-45"
58-
android:textSize="20sp"/>
59-
60-
6171
</RelativeLayout>
6272

6373

0 commit comments

Comments
 (0)