Skip to content

Commit

Permalink
feat(about): add GitHub infos
Browse files Browse the repository at this point in the history
Signed-off-by: Teclib <skita@teclib.com>
  • Loading branch information
stonebuzz committed Sep 30, 2021
1 parent d61d2f4 commit 3669d53
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ public void loadAbout(Context context) {

private String aboutStr(String version, String build, String date, String commit, String commitFull, String github) {
String str = "Inventory Agent, version "+ version +", build "+ build +".<br />";
str += "Built on "+ date +". Last commit <a href='"+github+"/commit/"+commitFull+"'>"+ commit +"</a>.<br />";
str += "© <a href='http://teclib-edition.com/'>Teclib'</a>. Licensed under <a href='https://www.gnu.org/licenses/gpl-3.0.en.html'>GPLv3</a>. <a href='https://flyve-mdm.com/'>GLPI Android Inventory Agent</a>®";
str += "Built on "+ date + ".<br />" /*+". Last commit <a href='"+github+"/commit/"+commitFull+"'>"+ commit +"</a>.<br />"*/;
str += "© <a href='http://teclib-edition.com/'>Teclib'</a>. Licensed under <a href='https://www.gnu.org/licenses/gpl-3.0.en.html'>GPLv3</a>. <a href='https://flyve-mdm.com/'>GLPI Android Inventory Agent</a>®<br />See us on GitHub<br />";

return str;
}
Expand Down
17 changes: 17 additions & 0 deletions app/src/main/java/org/glpi/inventory/agent/ui/FragmentAbout.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@

package org.glpi.inventory.agent.ui;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
Expand All @@ -56,15 +58,30 @@ public class FragmentAbout extends Fragment implements About.View {

private About.Presenter presenter;
private TextView txtAbout;
private ImageView imgGithub;

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {


View v = inflater.inflate(R.layout.fragment_about, null);

presenter = new AboutPresenter(this);

txtAbout = v.findViewById(R.id.txtAbout);
imgGithub = v.findViewById(R.id.imgGithub);

imgGithub.setOnClickListener(new View.OnClickListener() {

public void onClick(View v) {
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.addCategory(Intent.CATEGORY_BROWSABLE);
intent.setData(Uri.parse("https://github.com/glpi-project/android-inventory-agent"));
startActivity(intent);
}
});


ImageView imgInventory = v.findViewById(R.id.imgInventory);
imgInventory.setOnClickListener(new View.OnClickListener() {
Expand Down
Binary file added app/src/main/res/drawable/github.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 17 additions & 6 deletions app/src/main/res/layout/fragment_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,27 @@
android:id="@+id/txtAbout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/menu_about"
android:hint="@string/menu_about"
android:gravity="center"
android:layout_alignParentBottom="true"
android:layout_marginBottom="20dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:textSize="12sp"
android:layout_marginBottom="44dp"
android:gravity="center"
android:hint="@string/menu_about"
android:labelFor="@id/imgInventory"
android:lineSpacingExtra="6dp"
/>
android:text="@string/menu_about"
android:textSize="12sp" />

<ImageView
android:id="@+id/imgGithub"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:adjustViewBounds="true"
android:maxWidth="150dp"
android:clickable="true"
android:src="@drawable/github"
android:focusable="true" />

</RelativeLayout>

0 comments on commit 3669d53

Please sign in to comment.