1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-26 02:25:50 +01:00

Re-do logo logic for AboutScreen to keep aspect ratio

This commit is contained in:
vanous 2020-09-10 10:46:09 +02:00
parent 1c2218079b
commit db47992199
2 changed files with 24 additions and 29 deletions

View File

@ -17,42 +17,23 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */ along with this program. If not, see <http://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.activities; package nodomain.freeyourgadget.gadgetbridge.activities;
import android.graphics.LightingColorFilter;
import android.graphics.drawable.InsetDrawable;
import android.os.Bundle; import android.os.Bundle;
import android.text.method.LinkMovementMethod; import android.text.method.LinkMovementMethod;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.TextView; import android.widget.TextView;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
import nodomain.freeyourgadget.gadgetbridge.R; import nodomain.freeyourgadget.gadgetbridge.R;
public class AboutActivity extends AbstractGBActivity { public class AboutActivity extends AbstractGBActivity {
private static final Logger LOG = LoggerFactory.getLogger(AboutActivity.class);
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about); setContentView(R.layout.activity_about);
ScrollView aboutBackground = findViewById(R.id.about_background);
if (!GBApplication.isDarkThemeEnabled()) {
aboutBackground.getBackground().setColorFilter(new LightingColorFilter(0x0, 0x00EEEEEE));
} else {
aboutBackground.getBackground().setColorFilter(new LightingColorFilter(0x0, 0x00404040));
}
TextView link1 = findViewById(R.id.links1); TextView link1 = findViewById(R.id.links1);
link1.setMovementMethod(LinkMovementMethod.getInstance()); link1.setMovementMethod(LinkMovementMethod.getInstance());
TextView link2 = findViewById(R.id.links2); TextView link2 = findViewById(R.id.links2);
link2.setMovementMethod(LinkMovementMethod.getInstance()); link2.setMovementMethod(LinkMovementMethod.getInstance());
TextView link3 = findViewById(R.id.links3); TextView link3 = findViewById(R.id.links3);
link3.setMovementMethod(LinkMovementMethod.getInstance()); link3.setMovementMethod(LinkMovementMethod.getInstance());
} }
} }

View File

@ -1,9 +1,24 @@
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/no_items_bg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:alpha="0.1"
android:contentDescription="@string/icon_placeholder"
android:tint="?attr/textColorPrimary"
app:srcCompat="@drawable/gadgetbridge_img" />
<ScrollView
android:id="@+id/about_background" android:id="@+id/about_background"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@drawable/gadgetbridge_img"
android:paddingLeft="@dimen/about_margin" android:paddingLeft="@dimen/about_margin"
android:paddingRight="@dimen/about_margin" android:paddingRight="@dimen/about_margin"
tools:context="nodomain.freeyourgadget.gadgetbridge.activities.AboutActivity"> tools:context="nodomain.freeyourgadget.gadgetbridge.activities.AboutActivity">
@ -144,7 +159,6 @@
android:textColor="@color/accent" /> android:textColor="@color/accent" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</ScrollView>
</ScrollView> </RelativeLayout>