mirror of
https://github.com/MatomoCamp/matomocamp-companion-android.git
synced 2024-09-19 16:13:46 +02:00
Added extended title Toolbar for PersonInfoActivity
+ Fixed toolbar elevation value.
This commit is contained in:
parent
d00daadd78
commit
49dd79a187
8 changed files with 63 additions and 27 deletions
|
@ -59,7 +59,9 @@
|
|||
<data android:mimeType="application/be.digitalia.fosdem"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name=".activities.PersonInfoActivity"/>
|
||||
<activity
|
||||
android:name=".activities.PersonInfoActivity"
|
||||
android:theme="@style/AppTheme.NoActionBar"/>
|
||||
<activity
|
||||
android:name=".activities.SearchResultActivity"
|
||||
android:launchMode="singleTop">
|
||||
|
|
|
@ -189,9 +189,7 @@ public class MainActivity extends ActionBarActivity implements ListView.OnItemCl
|
|||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.main);
|
||||
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
|
||||
|
||||
progressBar = (ProgressBar) findViewById(R.id.progress);
|
||||
|
||||
|
|
|
@ -4,7 +4,10 @@ import android.os.Bundle;
|
|||
import android.support.v4.app.Fragment;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.support.v7.app.ActionBarActivity;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.MenuItem;
|
||||
import android.widget.TextView;
|
||||
|
||||
import be.digitalia.fosdem.R;
|
||||
import be.digitalia.fosdem.fragments.PersonInfoListFragment;
|
||||
import be.digitalia.fosdem.model.Person;
|
||||
|
@ -16,13 +19,15 @@ public class PersonInfoActivity extends ActionBarActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.content);
|
||||
setContentView(R.layout.content_extended_title);
|
||||
setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
|
||||
|
||||
Person person = getIntent().getParcelableExtra(EXTRA_PERSON);
|
||||
|
||||
ActionBar bar = getSupportActionBar();
|
||||
bar.setDisplayHomeAsUpEnabled(true);
|
||||
bar.setTitle(R.string.person_info);
|
||||
bar.setDisplayShowTitleEnabled(false);
|
||||
((TextView) findViewById(R.id.title)).setText(person.getName());
|
||||
|
||||
if (savedInstanceState == null) {
|
||||
Fragment f = PersonInfoListFragment.newInstance(person);
|
||||
|
@ -33,9 +38,9 @@ public class PersonInfoActivity extends ActionBarActivity {
|
|||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case android.R.id.home:
|
||||
finish();
|
||||
return true;
|
||||
case android.R.id.home:
|
||||
finish();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ import android.view.MenuInflater;
|
|||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import be.digitalia.fosdem.R;
|
||||
import be.digitalia.fosdem.activities.EventDetailsActivity;
|
||||
import be.digitalia.fosdem.adapters.EventsAdapter;
|
||||
|
@ -55,10 +55,10 @@ public class PersonInfoListFragment extends SmoothListFragment implements Loader
|
|||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.more_info:
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(person.getUrl()));
|
||||
startActivity(intent);
|
||||
return true;
|
||||
case R.id.more_info:
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(person.getUrl()));
|
||||
startActivity(intent);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -76,7 +76,6 @@ public class PersonInfoListFragment extends SmoothListFragment implements Loader
|
|||
listView.setScrollBarStyle(ListView.SCROLLBARS_OUTSIDE_OVERLAY);
|
||||
|
||||
View headerView = LayoutInflater.from(getActivity()).inflate(R.layout.header_person_info, null);
|
||||
((TextView) headerView.findViewById(R.id.title)).setText(person.getName());
|
||||
getListView().addHeaderView(headerView, null, false);
|
||||
|
||||
setListAdapter(adapter);
|
||||
|
|
43
app/src/main/res/layout/content_extended_title.xml
Normal file
43
app/src/main/res/layout/content_extended_title.xml
Normal file
|
@ -0,0 +1,43 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:elevation="@dimen/toolbar_elevation"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/Toolbar.Fosdem"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="@null"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingBottom="@dimen/content_margin"
|
||||
android:paddingLeft="@dimen/content_margin"
|
||||
android:paddingRight="@dimen/content_margin"
|
||||
android:paddingTop="8dp"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Widget.ActionBar.Title.Inverse"
|
||||
tools:text="Title"/>
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"/>
|
||||
</LinearLayout>
|
|
@ -1,21 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
style="@style/TextAppearance.AppCompat.Headline"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textIsSelectable="true"
|
||||
tools:text="FOSDEM Staff"/>
|
||||
|
||||
<TextView
|
||||
style="@style/Header"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/talks_header"/>
|
||||
|
||||
<View style="@style/HeaderLine"/>
|
||||
|
|
|
@ -9,6 +9,6 @@
|
|||
<dimen name="list_item_medium_text_size">16sp</dimen>
|
||||
<dimen name="list_item_small_text_size">14sp</dimen>
|
||||
<dimen name="content_margin">16dp</dimen>
|
||||
<dimen name="toolbar_elevation">6dp</dimen>
|
||||
<dimen name="toolbar_elevation">8dp</dimen>
|
||||
|
||||
</resources>
|
|
@ -102,7 +102,6 @@
|
|||
</plurals>
|
||||
|
||||
<!-- Speaker info -->
|
||||
<string name="person_info">Speaker info</string>
|
||||
<string name="talks_header">TALKS</string>
|
||||
<string name="more_info">More info</string>
|
||||
|
||||
|
|
Loading…
Reference in a new issue