Commit b84f652d authored by Lennart Bader's avatar Lennart Bader
Browse files

Added ToolbarHeader for Office

parent 7f76e77f
......@@ -5,16 +5,13 @@ import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.CardView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import java.net.URLEncoder;
import java.util.ArrayList;
import de.mytfg.apps.vplan.R;
import de.mytfg.apps.vplan.activities.MainActivity;
......@@ -34,6 +31,8 @@ public class OfficeFragment extends AuthenticationFragment {
setHasOptionsMenu(true);
context.getToolbarManager()
.clear()
.setImage(R.mipmap.office_header)
.showBottomScrim()
.setTitle(getString(R.string.menutitle_secretary))
.setExpandable(true, true);
......@@ -69,37 +68,6 @@ public class OfficeFragment extends AuthenticationFragment {
startActivity(i);
}
});
/*CardView mytfg = (CardView) view.findViewById(R.id.link_mytfg);
mytfg.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(mytfgUrl));
startActivity(i);
}
});
final CardView moodle = (CardView) view.findViewById(R.id.link_moodle);
moodle.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(moodleUrl));
startActivity(i);
}
});
CardView tfg = (CardView) view.findViewById(R.id.link_tfg_web);
tfg.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(tfgUrl));
startActivity(i);
}
});
*/
return view;
}
......
......@@ -80,6 +80,7 @@ public class ToolbarManager {
this.setImage(R.mipmap.front);
this.clearMenu();
this.setTabs(false);
this.hideBottomScrim();
this.setTabOutscroll(false);
return this;
}
......@@ -168,6 +169,18 @@ public class ToolbarManager {
return this;
}
public ToolbarManager showBottomScrim() {
View scrim = collapsingToolbarLayout.findViewById(R.id.toolbar_scrim_bottom);
scrim.setVisibility(View.VISIBLE);
return this;
}
public ToolbarManager hideBottomScrim() {
View scrim = collapsingToolbarLayout.findViewById(R.id.toolbar_scrim_bottom);
scrim.setVisibility(View.GONE);
return this;
}
public SearchView getSearchView() {
MenuItem searchItem = toolbar.getMenu().findItem(R.id.action_search);
if (searchItem != null) {
......
......@@ -27,6 +27,14 @@
android:id="@+id/toolbar_image"
android:src="@mipmap/front"/>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/sheet_text_scrim_height_bottom"
android:layout_gravity="bottom"
android:id="@+id/toolbar_scrim_bottom"
android:layout_alignBottom="@+id/toolbar_image"
android:background="@drawable/scrim_bottom"/>
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment