diff --git a/app/src/main/java/org/hisp/dhis/android/dashboard/ui/activities/MenuActivity.java b/app/src/main/java/org/hisp/dhis/android/dashboard/ui/activities/MenuActivity.java index 68b5997d..c08f03a8 100755 --- a/app/src/main/java/org/hisp/dhis/android/dashboard/ui/activities/MenuActivity.java +++ b/app/src/main/java/org/hisp/dhis/android/dashboard/ui/activities/MenuActivity.java @@ -48,6 +48,7 @@ import org.hisp.dhis.android.dashboard.api.models.UserAccount; import org.hisp.dhis.android.dashboard.api.persistence.loaders.DbLoader; import org.hisp.dhis.android.dashboard.api.persistence.loaders.Query; +import org.hisp.dhis.android.dashboard.ui.fragments.AboutFragment; import org.hisp.dhis.android.dashboard.ui.fragments.AccountFragment; import org.hisp.dhis.android.dashboard.ui.fragments.SettingsFragment; import org.hisp.dhis.android.dashboard.ui.fragments.dashboard.DashboardContainerFragment; @@ -124,6 +125,9 @@ public boolean onNavigationItemSelected(MenuItem menuItem) { attachFragmentDelayed(new SettingsFragment()); break; } + case R.id.menu_about_item: { + attachFragment(new AboutFragment()); + } /* case R.id.menu_about_item: { getDhisController().invalidateSession(); startActivity(new Intent(this, LauncherActivity.class)); diff --git a/app/src/main/java/org/hisp/dhis/android/dashboard/ui/fragments/AboutFragment.java b/app/src/main/java/org/hisp/dhis/android/dashboard/ui/fragments/AboutFragment.java new file mode 100644 index 00000000..d7ab0679 --- /dev/null +++ b/app/src/main/java/org/hisp/dhis/android/dashboard/ui/fragments/AboutFragment.java @@ -0,0 +1,64 @@ +package org.hisp.dhis.android.dashboard.ui.fragments; + +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.support.annotation.Nullable; +import android.support.v7.widget.Toolbar; +import android.text.Html; +import android.text.method.LinkMovementMethod; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import org.hisp.dhis.android.dashboard.BuildConfig; +import org.hisp.dhis.android.dashboard.R; + +import butterknife.Bind; +import butterknife.ButterKnife; +import butterknife.OnClick; + +/** + * Created by siddharthsingh on 05/03/16. + */ +public class AboutFragment extends BaseFragment { + @Bind(R.id.toolbar) + Toolbar mToolbar; + TextView mVersionNumber,mWebsite,mEmail; + @Nullable + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + return inflater.inflate(R.layout.fragment_about, container, false); + } + + @Override + public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { + ButterKnife.bind(this, view); + mToolbar.setNavigationIcon(R.mipmap.ic_menu); + mToolbar.setTitle(R.string.about); + mVersionNumber=(TextView) view.findViewById(R.id.version_textview); + mWebsite=(TextView) view.findViewById(R.id.website_textview); + mEmail=(TextView) view.findViewById(R.id.email_textview); + mToolbar.setNavigationOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + toggleNavigationDrawer(); + } + }); + mVersionNumber.setText("version" + " " + BuildConfig.VERSION_NAME); + mWebsite.setClickable(true); + mWebsite.setMovementMethod(LinkMovementMethod.getInstance()); + String text = " Visit Website "; + mWebsite.setText(Html.fromHtml(text)); + mEmail.setText(Html.fromHtml("Send Feedback")); + mEmail.setMovementMethod(LinkMovementMethod.getInstance()); + } + + @OnClick(R.id.check_for_update_button) + @SuppressWarnings("unused") + public void onClick() { + Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=org.hisp.dhis.android.dashboard")); + startActivity(intent); + } +} diff --git a/app/src/main/res/drawable-hdpi/ic_dhis_logo.png b/app/src/main/res/drawable-hdpi/ic_dhis_logo.png new file mode 100755 index 00000000..40dbc3a1 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_dhis_logo.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_dhis_logo.png b/app/src/main/res/drawable-mdpi/ic_dhis_logo.png new file mode 100755 index 00000000..f382dd73 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_dhis_logo.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_dhis_logo.png b/app/src/main/res/drawable-xhdpi/ic_dhis_logo.png new file mode 100755 index 00000000..0b17eaf0 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_dhis_logo.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_dhis_logo.png b/app/src/main/res/drawable-xxhdpi/ic_dhis_logo.png new file mode 100755 index 00000000..4b00872a Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_dhis_logo.png differ diff --git a/app/src/main/res/layout/fragment_about.xml b/app/src/main/res/layout/fragment_about.xml new file mode 100644 index 00000000..2116d700 --- /dev/null +++ b/app/src/main/res/layout/fragment_about.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + +