forked from dhis2/dhis2-android-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bc0a17c
commit a1c1483
Showing
9 changed files
with
166 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
app/src/main/java/org/hisp/dhis/android/dashboard/ui/fragments/AboutFragment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 = "<a href='https://www.dhis2.org'> Visit Website </a>"; | ||
mWebsite.setText(Html.fromHtml(text)); | ||
mEmail.setText(Html.fromHtml("<a href=\"mailto:dhis2mobileteam@gmail.com\">Send Feedback</a>")); | ||
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); | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
~ Copyright (c) 2015, University of Oslo | ||
~ | ||
~ All rights reserved. | ||
~ Redistribution and use in source and binary forms, with or without | ||
~ modification, are permitted provided that the following conditions are met: | ||
~ Redistributions of source code must retain the above copyright notice, this | ||
~ list of conditions and the following disclaimer. | ||
~ | ||
~ Redistributions in binary form must reproduce the above copyright notice, | ||
~ this list of conditions and the following disclaimer in the documentation | ||
~ and/or other materials provided with the distribution. | ||
~ Neither the name of the HISP project nor the names of its contributors may | ||
~ be used to endorse or promote products derived from this software without | ||
~ specific prior written permission. | ||
~ | ||
~ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
~ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
~ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
~ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | ||
~ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
~ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
~ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
~ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
~ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
~ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
--> | ||
<RelativeLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:fitsSystemWindows="true"> | ||
<include | ||
android:id="@+id/toolbar" | ||
layout="@layout/toolbar" | ||
android:layout_width="match_parent" | ||
android:layout_height="?attr/actionBarSize" | ||
android:layout_alignParentTop="true"/> | ||
|
||
<ImageView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:id="@+id/imageView" | ||
android:src="@drawable/ic_dhis_logo" | ||
android:paddingTop="120dp" | ||
android:paddingBottom="30dp"/> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:textAppearance="?android:attr/textAppearanceLarge" | ||
android:text="" | ||
android:id="@+id/version_textview" | ||
android:paddingBottom="30dp" | ||
android:layout_below="@+id/imageView" | ||
|
||
android:gravity="center" /> | ||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:textAppearance="?android:attr/textAppearanceLarge" | ||
android:text="" | ||
android:id="@+id/website_textview" | ||
android:paddingBottom="30dp" | ||
android:layout_below="@+id/version_textview" | ||
android:gravity="center" /> | ||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:textAppearance="?android:attr/textAppearanceLarge" | ||
android:text="" | ||
android:paddingBottom="45dp" | ||
android:id="@+id/email_textview" | ||
android:layout_below="@+id/website_textview" | ||
android:gravity="center" /> | ||
|
||
<Button | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="@string/check_for_update" | ||
android:id="@+id/check_for_update_button" | ||
android:layout_below="@+id/email_textview" | ||
android:layout_alignParentBottom="true" | ||
android:background="@drawable/button_blue_selector" | ||
android:textColor="@color/white" | ||
android:layout_alignParentStart="true" | ||
android:layout_marginTop="70dp" | ||
/> | ||
|
||
</RelativeLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a1c1483
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@siddharth7 Great work and thank you for contribution.
The only thing which I would like to ask you is to re-submit the pull-request. I see that you first added AboutFragment with related resources, then removed it and added again. It is a little bit confusing and also pollutes commit history.
Also, could you please do not touch LoginActivity entry in manifest? It was already fixed by another student and will cause conflicts.