Skip to content

Commit ac58ea7

Browse files
committed
- left out some files on last commit
1 parent d8898f5 commit ac58ea7

22 files changed

Lines changed: 955 additions & 0 deletions
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package org.sofwerx.torgi.ui;
2+
3+
import android.os.Bundle;
4+
import android.widget.TextView;
5+
6+
import org.sofwerx.torgi.R;
7+
8+
public class MainActivity extends AbstractTORGIActivity {
9+
private TextView status;
10+
11+
@Override
12+
public void onCreate(Bundle savedInstanceState) {
13+
super.onCreate(savedInstanceState);
14+
status = findViewById(R.id.textView);
15+
}
16+
17+
@Override
18+
public void onResume() {
19+
super.onResume();
20+
if (permissionsPassed)
21+
status.setText(getString(R.string.notification));
22+
else
23+
status.setText(getString(R.string.torgi_not_running));
24+
}
25+
26+
@Override
27+
protected int getLayout() {
28+
return R.layout.activity_logger;
29+
}
30+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
5+
android:layout_width="match_parent"
6+
android:layout_height="match_parent"
7+
android:orientation="vertical"
8+
tools:context=".ui.MainActivity">
9+
10+
<ImageView
11+
android:id="@+id/imageView"
12+
android:layout_width="80dp"
13+
android:layout_height="80dp"
14+
android:layout_centerInParent="true"
15+
android:src="@drawable/icon_gnns" />
16+
17+
<TextView
18+
android:id="@+id/textView"
19+
android:layout_width="wrap_content"
20+
android:layout_height="wrap_content"
21+
android:layout_below="@+id/imageView"
22+
android:layout_centerHorizontal="true"
23+
android:gravity="center"
24+
android:text="@string/torgi_not_running"
25+
android:textSize="20sp" />
26+
</RelativeLayout>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<resources>
2+
<string name="app_name">TORGI Logger</string>
3+
</resources>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="org.sofwerx.torgi">
4+
<application>
5+
<activity
6+
android:name=".ui.AboutActivity"
7+
android:label="@string/about">
8+
</activity>
9+
</application>
10+
</manifest>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package org.sofwerx.torgi.ui;
2+
3+
import android.app.Activity;
4+
import android.os.Bundle;
5+
import android.text.Html;
6+
import android.text.method.LinkMovementMethod;
7+
import android.view.View;
8+
import android.widget.TextView;
9+
10+
import org.sofwerx.torgi.R;
11+
import org.sofwerx.torgi.util.Acknowledgements;
12+
13+
public class AboutActivity extends Activity {
14+
private TextView ackTitle;
15+
private TextView ack;
16+
private TextView licTitle;
17+
private TextView lic;
18+
19+
@Override
20+
protected void onCreate(Bundle savedInstanceState) {
21+
super.onCreate(savedInstanceState);
22+
setContentView(R.layout.about_activity);
23+
//Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
24+
//setSupportActionBar(toolbar);
25+
ackTitle = findViewById(R.id.legalAckTitle);
26+
ack = findViewById(R.id.legalAck);
27+
licTitle = findViewById(R.id.legalLicenseTitle);
28+
lic = findViewById(R.id.legalLicense);
29+
ackTitle.setOnClickListener(v -> {
30+
if (ack.getVisibility() == View.VISIBLE) {
31+
ack.setVisibility(View.GONE);
32+
ackTitle.setCompoundDrawablesWithIntrinsicBounds(R.drawable.icon_expanded_white, 0, 0, 0);
33+
} else {
34+
ack.setVisibility(View.VISIBLE);
35+
ackTitle.setCompoundDrawablesWithIntrinsicBounds(R.drawable.icon_expandable_white, 0, 0, 0);
36+
}
37+
});
38+
licTitle.setOnClickListener(v -> {
39+
if (lic.getVisibility() == View.VISIBLE) {
40+
lic.setVisibility(View.GONE);
41+
licTitle.setCompoundDrawablesWithIntrinsicBounds(R.drawable.icon_expanded_white, 0, 0, 0);
42+
} else {
43+
lic.setVisibility(View.VISIBLE);
44+
licTitle.setCompoundDrawablesWithIntrinsicBounds(R.drawable.icon_expandable_white, 0, 0, 0);
45+
}
46+
});
47+
ack.setText(Html.fromHtml(Acknowledgements.getCredits()));
48+
ack.setMovementMethod(LinkMovementMethod.getInstance());
49+
lic.setText(Html.fromHtml(Acknowledgements.getLicenses()));
50+
lic.setMovementMethod(LinkMovementMethod.getInstance());
51+
}
52+
}

0 commit comments

Comments
 (0)