Commit 2c2f66d3 authored by Lennart Bader's avatar Lennart Bader
Browse files

Added OfficeFragment, new Icons and added "Clickable Animation" to CardViews in Office and Links

parent 2b5914e7
......@@ -20,6 +20,7 @@ import de.mytfg.apps.vplan.api.MyTFGApi;
import de.mytfg.apps.vplan.fragments.AboutFragment;
import de.mytfg.apps.vplan.fragments.AuthenticationFragment;
import de.mytfg.apps.vplan.fragments.LinksFragment;
import de.mytfg.apps.vplan.fragments.OfficeFragment;
import de.mytfg.apps.vplan.fragments.SettingsFragment;
import de.mytfg.apps.vplan.fragments.LoginFragment;
import de.mytfg.apps.vplan.fragments.PlanFragment;
......@@ -98,6 +99,10 @@ public class MainActivity extends AppCompatActivity {
navigationView.getMenu().clear();
navigationView.inflateMenu(R.menu.navigation_menu);
return true;
case R.id.submenu_partners_secretary:
navi.clear();
navi.navigate(new OfficeFragment(), R.id.fragment_container);
return true;
}
}
});
......
package de.mytfg.apps.vplan.fragments;
import android.content.Intent;
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;
public class OfficeFragment extends AuthenticationFragment {
private final String addressString = "Kalkumer Schlossallee 28 40489 Düsseldorf";
public OfficeFragment() {
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_office, container, false);
MainActivity context = (MainActivity)this.getActivity();
setHasOptionsMenu(true);
context.getToolbarManager()
.clear()
.setTitle(getString(R.string.menutitle_secretary))
.setExpandable(true, true);
CardView address = (CardView) view.findViewById(R.id.office_address);
address.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i = new Intent(Intent.ACTION_VIEW,
Uri.parse(String.format("geo:0,0?q=%s",
URLEncoder.encode(addressString))));
startActivity(i);
}
});
final String num = getString(R.string.office_phone_val).replace("/", "");
CardView phone = (CardView) view.findViewById(R.id.office_phone);
phone.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i = new Intent(Intent.ACTION_DIAL,
Uri.parse("tel:" + num));
startActivity(i);
}
});
CardView mail = (CardView) view.findViewById(R.id.office_mail);
mail.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i = new Intent(Intent.ACTION_SENDTO);
i.setData(Uri.parse("mailto:" + getString(R.string.office_mail_val)));
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;
}
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
menu.clear();
super.onCreateOptionsMenu(menu, inflater);
}
}
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