Skip to content
New issue

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

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

Already on GitHub? # to your account

feat: Change action bar title . #64

Merged
merged 2 commits into from
Jan 25, 2020
Merged
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
25 changes: 23 additions & 2 deletions app/src/main/java/info/anwesha/iitp/events/EventsFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,30 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {

String new_show="Test";
if (getActivity() != null)
((AppCompatActivity) getActivity()).getSupportActionBar().setTitle(category + " Events");
{
if(category.equals("awelfare"))
new_show="Arts and Welfare";
else
if(category.equals("cultural"))
new_show="Cultural";
else
if(category.equals("technical"))
new_show="Technical";
else
if(category.equals("proshow"))
new_show="Proshow";
else
if(category.equals("pronite"))
new_show="Pronite";
else
if(category.equals("pre-anwesha"))
new_show="Pre-Anwesha";
else
if(category.equals("informal"))
new_show="Informal";
((AppCompatActivity) getActivity()).getSupportActionBar().setTitle(new_show + " Events");}

swipeRefreshLayout = view.findViewById(R.id.swipe_refresh_events);
swipeRefreshLayout.setOnRefreshListener(this::updateData);
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/info/anwesha/iitp/home/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ else if (day == 9)

if (v != null) {
String name = prefs.getString("first_name", "");
((TextView) v.findViewById(R.id.name)).setText(name.isEmpty() ? " Anwesha" : name);
((TextView) v.findViewById(R.id.name)).setText(name.isEmpty() ? " Anwesha " : name);
String IITP = prefs.getString("college_name", "");
((TextView) v.findViewById(R.id.iitp)).setText(IITP.isEmpty() ? " IIT Patna" : name);
((TextView) v.findViewById(R.id.iitp)).setText(IITP.isEmpty() ? " IIT Patna " : name);
String id = prefs.getString("celesta_id", "");
((TextView) v.findViewById(R.id.anwesha_id)).setText(id.isEmpty() ? str : id);
ImageView profileImage = v.findViewById(R.id.image);
Expand Down
17 changes: 10 additions & 7 deletions app/src/main/res/layout/nav_header_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
android:scaleType="centerCrop" />

<LinearLayout
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginStart="20dp"
Expand All @@ -33,32 +33,35 @@

<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="3dp"
android:textColor="@color/white"
android:maxLines="1"
android:textSize="16sp"
android:text="Somenath Sarkar" />
android:text="Somenath Sarkar"
android:gravity="center"/>

<TextView
android:id="@+id/iitp"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="3dp"
android:textColor="@color/white"
android:maxLines="1"
android:textSize="14sp"
android:text="Sep14" />
android:text="Sep14"
android:gravity="center"/>

<TextView
android:id="@+id/anwesha_id"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="3dp"
android:textSize="14sp"
android:textColor="@color/white"
android:text="ANW2500" />
android:text="ANW2500"
android:gravity="center"/>


</LinearLayout>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/navigation/mobile_navigation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<fragment
android:id="@+id/nav_ongoing"
android:name="info.anwesha.iitp.livefeed.LiveFeedFragment"
android:label="News Feed"
android:label="Live Feed"
tools:layout="@layout/fragment_events" />

<fragment
Expand Down