forked from fixme-lausanne/MyHackerspace
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from niccokunzmann/add-about
Add about entry in the settings
- Loading branch information
Showing
5 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
app/src/main/java/io/spaceapi/community/myhackerspace/AboutLayout.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,40 @@ | ||
package io.spaceapi.community.myhackerspace; | ||
|
||
import android.content.Context; | ||
import android.util.AttributeSet; | ||
import android.view.LayoutInflater; | ||
import android.widget.LinearLayout; | ||
import android.widget.TextView; | ||
|
||
import androidx.annotation.Nullable; | ||
|
||
public class AboutLayout extends LinearLayout { | ||
|
||
public AboutLayout(Context context) { | ||
super(context); | ||
} | ||
|
||
public AboutLayout(Context context, @Nullable AttributeSet attrs) { | ||
super(context, attrs); | ||
} | ||
|
||
public AboutLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { | ||
super(context, attrs, defStyleAttr); | ||
} | ||
|
||
public AboutLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { | ||
super(context, attrs, defStyleAttr, defStyleRes); | ||
} | ||
|
||
public void init() { | ||
TextView version = findViewById(R.id.about_version_text); | ||
version.setText(BuildConfig.VERSION_NAME + " (" + Integer.toString(BuildConfig.VERSION_CODE) + ")"); | ||
} | ||
|
||
public static AboutLayout create(Context context) { | ||
LayoutInflater layoutInflater = LayoutInflater.from(context); | ||
AboutLayout about = (AboutLayout) layoutInflater.inflate(R.layout.about, null, false); | ||
about.init(); | ||
return about; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<io.spaceapi.community.myhackerspace.AboutLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:paddingStart="8dp" | ||
android:paddingTop="8dp" | ||
android:orientation="vertical"> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="horizontal"> | ||
|
||
<TextView | ||
android:id="@+id/about_version_title" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="@string/about_version_title" /> | ||
|
||
<TextView | ||
android:id="@+id/about_version_text" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_weight="1" | ||
android:layout_marginStart="2sp" | ||
android:text="{version}" /> | ||
</LinearLayout> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="horizontal"> | ||
|
||
<TextView | ||
android:id="@+id/about_license_title" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="@string/about_license_title" /> | ||
|
||
<TextView | ||
android:id="@+id/about_license_text" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_weight="1" | ||
android:layout_marginStart="2sp" | ||
android:text="@string/about_license_text" /> | ||
</LinearLayout> | ||
|
||
<TextView | ||
android:id="@+id/about_repository" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:autoLink="web" | ||
android:text="@string/about_repository_url" /> | ||
|
||
</io.spaceapi.community.myhackerspace.AboutLayout> |
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