Skip to content

Commit 9b7b68b

Browse files
author
Dmitry Tretyakov
committed
build(debug): 41
Replaced `ovk.to` with `openvk.su` instance due to the hijacking of the `ovk.to` domain by the registrar
1 parent 9969e98 commit 9b7b68b

File tree

13 files changed

+170
-210
lines changed

13 files changed

+170
-210
lines changed

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ android {
3737
applicationId "uk.openvk.android.refresh"
3838
minSdk 21
3939
targetSdk 36
40-
versionCode 40
41-
versionName "0.9.40.alpha"
40+
versionCode 41
41+
versionName "0.9.41.alpha"
4242
}
4343

4444
buildTypes {

app/src/main/java/uk/openvk/android/refresh/ui/core/activities/AuthActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public void signIn(String instance, String username, String password) {
144144
if(instance.equals("vk.com") || instance.equals("vk.ru") || instance.equals("vkontakte.ru")) {
145145
ft = getSupportFragmentManager().beginTransaction();
146146
ft.replace(R.id.dynamic_fragment_layout, new AuthFragment());
147-
instance = "ovk.to";
147+
instance = "openvk.su";
148148
ft.commit();
149149
authFragment.setAuthorizationData(instance, username, password);
150150
showOvkWarning();

app/src/main/java/uk/openvk/android/refresh/ui/core/activities/MainSettingsActivity.java

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import android.os.Bundle;
66
import android.util.TypedValue;
77
import android.view.View;
8+
import android.widget.Toolbar;
89

910
import com.google.android.material.appbar.MaterialToolbar;
1011
import com.kieronquinn.monetcompat.core.MonetCompat;
@@ -87,25 +88,7 @@ private void setAppBar() {
8788
toolbar = findViewById(R.id.app_toolbar);
8889
toolbar.setNavigationIcon(R.drawable.ic_arrow_back);
8990
toolbar.setTitle(getResources().getString(R.string.nav_settings));
90-
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
91-
@Override
92-
public void onClick(View view) {
93-
onBackPressed();
94-
}
95-
});
96-
if(!Global.checkMonet(this)) {
97-
TypedValue typedValue = new TypedValue();
98-
boolean isDarkThemeEnabled = (getResources().getConfiguration().uiMode
99-
& Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES;
100-
if (isDarkThemeEnabled) {
101-
getTheme().resolveAttribute(androidx.appcompat.R.attr.background, typedValue,
102-
true);
103-
} else {
104-
getTheme().resolveAttribute(androidx.appcompat.R.attr.colorPrimaryDark, typedValue,
105-
true);
106-
}
107-
getWindow().setStatusBarColor(typedValue.data);
108-
}
91+
toolbar.setNavigationOnClickListener(view -> onBackPressed());
10992
}
11093

11194
public void switchFragment(String tag) {

app/src/main/java/uk/openvk/android/refresh/ui/core/activities/NewPostActivity.java

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -107,20 +107,12 @@ private void setAppBar() {
107107
toolbar = findViewById(R.id.app_toolbar);
108108
toolbar.setNavigationIcon(R.drawable.ic_arrow_back);
109109
toolbar.setTitle(getResources().getString(R.string.new_post_title));
110-
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
111-
@Override
112-
public void onClick(View view) {
113-
onBackPressed();
114-
}
115-
});
116-
toolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
117-
@Override
118-
public boolean onMenuItemClick(MenuItem item) {
119-
if(item.getItemId() == R.id.send) {
120-
sendPost();
121-
}
122-
return false;
110+
toolbar.setNavigationOnClickListener(view -> onBackPressed());
111+
toolbar.setOnMenuItemClickListener(item -> {
112+
if(item.getItemId() == R.id.send) {
113+
sendPost();
123114
}
115+
return false;
124116
});
125117
}
126118

app/src/main/java/uk/openvk/android/refresh/ui/core/fragments/auth/AuthFragment.java

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,20 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
4040
TextInputLayout password_layout = view.findViewById(R.id.password_layout);
4141
TextInputEditText username_edit = view.findViewById(R.id.username_edit);
4242
TextInputEditText password_edit = view.findViewById(R.id.password_edit);
43-
instance_edit.setText("ovk.to");
44-
sign_in_btn.setOnClickListener(new View.OnClickListener() {
45-
@Override
46-
public void onClick(View view) {
47-
if(getActivity() != null) {
48-
if (getActivity().getClass().getSimpleName().equals("AuthActivity")) {
49-
((AuthActivity) getActivity()).signIn(instance_edit.getText().toString(),
50-
Objects.requireNonNull(username_edit.getText()).toString(),
51-
Objects.requireNonNull(password_edit.getText()).toString());
52-
}
43+
instance_edit.setText("openvk.su");
44+
sign_in_btn.setOnClickListener(view -> {
45+
if(getActivity() != null) {
46+
if (getActivity().getClass().getSimpleName().equals("AuthActivity")) {
47+
((AuthActivity) getActivity()).signIn(instance_edit.getText().toString(),
48+
Objects.requireNonNull(username_edit.getText()).toString(),
49+
Objects.requireNonNull(password_edit.getText()).toString());
5350
}
5451
}
5552
});
5653

57-
register_btn.setOnClickListener(new View.OnClickListener() {
58-
@Override
59-
public void onClick(View v) {
60-
openWebAddress(String.format("http://%s/reg", instance_edit.getText().toString()));
61-
}
62-
});
54+
register_btn.setOnClickListener(v ->
55+
openWebAddress(String.format("http://%s/reg", instance_edit.getText().toString()))
56+
);
6357

6458
((LinearLayoutCompat) view.findViewById(R.id.auth_layout)).setGravity(Gravity.CENTER);
6559
instance_edit.setAdapter(
@@ -68,12 +62,9 @@ public void onClick(View v) {
6862
getResources().getStringArray(R.array.avaliable_instances)));
6963
TextInputLayout instance_layout = (view.findViewById(R.id.instance_input_layout));
7064
instance_edit.setThreshold(25000000);
71-
password_layout.setEndIconOnClickListener(new View.OnClickListener() {
72-
@Override
73-
public void onClick(View v) {
74-
openWebAddress(String.format("http://%s/restore", instance_edit.getText().toString()));
75-
}
76-
});
65+
password_layout.setEndIconOnClickListener(
66+
v -> openWebAddress(String.format("http://%s/restore", instance_edit.getText().toString()))
67+
);
7768
setMonetTheme();
7869
return view;
7970
}

app/src/main/res/layout-night/activity_new_post.xml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,22 @@
4343
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
4444
android:layout_width="match_parent"
4545
android:layout_height="match_parent"
46-
android:layout_margin="8dp"
47-
android:gravity="start|top">
46+
android:gravity="start|top"
47+
app:boxStrokeWidth="0dp"
48+
app:boxStrokeWidthFocused="0dp"
49+
app:hintEnabled="false">
4850

4951
<com.google.android.material.textfield.TextInputEditText
5052
android:id="@+id/status_edit"
5153
android:layout_width="match_parent"
5254
android:layout_height="match_parent"
55+
android:fontFamily="sans-serif-light"
5356
android:gravity="start|top"
5457
android:hint="@string/whats_new_hint"
5558
android:inputType="textMultiLine|text"
5659
android:maxLines="60"
57-
android:minLines="2" />
60+
android:minLines="2"
61+
android:textSize="20sp" />
5862
</com.google.android.material.textfield.TextInputLayout>
5963
</LinearLayout>
6064
</androidx.constraintlayout.widget.ConstraintLayout>

app/src/main/res/layout/activity_intent.xml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,17 @@
88

99
<com.google.android.material.appbar.MaterialToolbar
1010
android:id="@+id/app_toolbar"
11-
android:layout_width="match_parent"
12-
android:layout_height="wrap_content"
11+
android:layout_width="0dp"
12+
android:layout_height="?attr/actionBarSize"
1313
android:background="?attr/colorPrimary"
1414
android:minHeight="?attr/actionBarSize"
15-
android:theme="@style/ApplicationTheme.Toolbar.Dark"
15+
android:theme="?attr/actionBarTheme"
1616
app:contentInsetStartWithNavigation="0dp"
1717
app:layout_constraintBottom_toTopOf="@+id/fragment_screen"
1818
app:layout_constraintEnd_toEndOf="parent"
1919
app:layout_constraintStart_toStartOf="parent"
2020
app:layout_constraintTop_toTopOf="parent"
21-
app:menu="@menu/app_main"
22-
app:navigationIcon="@drawable/ic_menu"
21+
app:titleTextColor="@android:color/white"
2322
app:title="@string/app_name" />
2423

2524
<androidx.fragment.app.FragmentContainerView

app/src/main/res/layout/activity_new_post.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,21 @@
3838
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
3939
android:layout_width="match_parent"
4040
android:layout_height="match_parent"
41-
android:layout_margin="8dp">
41+
app:boxStrokeWidth="0dp"
42+
app:hintEnabled="false">
4243

4344
<com.google.android.material.textfield.TextInputEditText
4445
android:id="@+id/status_edit"
4546
android:layout_width="match_parent"
4647
android:layout_height="match_parent"
48+
android:fontFamily="sans-serif-light"
4749
android:gravity="start|top"
4850
android:hint="@string/whats_new_hint"
4951
android:inputType="textMultiLine|text"
5052
android:maxLines="60"
5153
android:minLines="2"
5254
android:textColorHint="#616161"
55+
android:textSize="20sp"
5356
tools:ignore="TextContrastCheck" />
5457
</com.google.android.material.textfield.TextInputLayout>
5558
</LinearLayout>

app/src/main/res/layout/dialog_about_instance.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
android:layout_width="match_parent"
4848
android:layout_height="wrap_content"
4949
android:layout_weight="1"
50-
android:text="ovk.to"
50+
android:text="openvk.su"
5151
tools:ignore="HardcodedText,InefficientWeight" />
5252

5353
</LinearLayout>

app/src/main/res/layout/fragment_profile.xml

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,29 @@
1818
android:layout_height="match_parent"
1919
android:visibility="gone" />
2020

21-
<androidx.coordinatorlayout.widget.CoordinatorLayout
22-
android:layout_width="match_parent"
23-
android:layout_height="match_parent">
21+
<androidx.coordinatorlayout.widget.CoordinatorLayout
22+
android:layout_width="match_parent"
23+
android:layout_height="match_parent">
2424

2525
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
2626
android:id="@+id/profile_swipe_layout"
2727
android:layout_width="match_parent"
2828
android:layout_height="match_parent"
29+
app:layout_behavior="@string/appbar_scrolling_view_behavior"
2930
app:layout_constraintBottom_toBottomOf="parent"
3031
app:layout_constraintEnd_toEndOf="parent"
31-
app:layout_constraintStart_toStartOf="parent"
32-
app:layout_behavior="@string/appbar_scrolling_view_behavior">
32+
app:layout_constraintStart_toStartOf="parent">
3333

34-
<androidx.viewpager2.widget.ViewPager2
35-
android:id="@+id/pager"
36-
android:layout_width="match_parent"
37-
android:layout_height="wrap_content"
38-
android:background="@color/newsfeedBackgroundColor"
39-
app:layout_behavior="@string/appbar_scrolling_view_behavior"
40-
app:layout_constraintBottom_toBottomOf="parent"
41-
app:layout_constraintEnd_toEndOf="parent"
42-
app:layout_constraintStart_toStartOf="parent"
43-
app:layout_constraintTop_toBottomOf="@+id/app_bar" />
34+
<androidx.viewpager2.widget.ViewPager2
35+
android:id="@+id/pager"
36+
android:layout_width="match_parent"
37+
android:layout_height="wrap_content"
38+
android:background="@color/newsfeedBackgroundColor"
39+
app:layout_behavior="@string/appbar_scrolling_view_behavior"
40+
app:layout_constraintBottom_toBottomOf="parent"
41+
app:layout_constraintEnd_toEndOf="parent"
42+
app:layout_constraintStart_toStartOf="parent"
43+
app:layout_constraintTop_toBottomOf="@+id/app_bar" />
4444
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
4545

4646
<uk.openvk.android.refresh.ui.view.layouts.ErrorLayout
@@ -53,44 +53,45 @@
5353
app:layout_constraintStart_toStartOf="parent"
5454
app:layout_constraintTop_toTopOf="parent" />
5555

56-
<com.google.android.material.appbar.AppBarLayout
57-
android:id="@+id/app_bar"
58-
android:layout_width="match_parent"
59-
android:layout_height="wrap_content"
60-
android:background="?attr/colorSurface"
61-
android:fitsSystemWindows="true"
62-
app:layout_constraintEnd_toEndOf="parent"
63-
app:layout_constraintStart_toStartOf="parent"
64-
app:layout_constraintTop_toTopOf="parent">
56+
<com.google.android.material.appbar.AppBarLayout
57+
android:id="@+id/app_bar"
58+
android:layout_width="match_parent"
59+
android:layout_height="wrap_content"
60+
android:background="?attr/colorSurface"
61+
android:fitsSystemWindows="true"
62+
app:layout_constraintEnd_toEndOf="parent"
63+
app:layout_constraintStart_toStartOf="parent"
64+
app:layout_constraintTop_toTopOf="parent">
6565

66-
<com.google.android.material.appbar.CollapsingToolbarLayout
67-
android:layout_width="match_parent"
68-
android:layout_height="wrap_content"
69-
android:background="?attr/colorSurface"
70-
android:fitsSystemWindows="true"
71-
app:layout_scrollFlags="scroll|snap|exitUntilCollapsed">
66+
<com.google.android.material.appbar.CollapsingToolbarLayout
67+
android:layout_width="match_parent"
68+
android:layout_height="wrap_content"
69+
android:background="?attr/colorSurface"
70+
android:fitsSystemWindows="true"
71+
app:layout_scrollFlags="scroll|snap|exitUntilCollapsed">
7272

73-
<uk.openvk.android.refresh.ui.view.layouts.ProfileHeader
74-
android:id="@+id/header"
75-
android:layout_width="match_parent"
76-
android:layout_height="match_parent"
77-
android:background="?attr/colorSurface"
78-
app:layout_collapseMode="parallax" />
73+
<uk.openvk.android.refresh.ui.view.layouts.ProfileHeader
74+
android:id="@+id/header"
75+
android:layout_width="match_parent"
76+
android:layout_height="match_parent"
77+
android:background="?attr/colorSurface"
78+
app:layout_collapseMode="parallax" />
7979

80-
</com.google.android.material.appbar.CollapsingToolbarLayout>
80+
</com.google.android.material.appbar.CollapsingToolbarLayout>
8181

82-
<com.google.android.material.tabs.TabLayout
83-
android:id="@+id/tab_layout"
84-
android:layout_width="match_parent"
85-
android:layout_height="wrap_content"
86-
android:layout_gravity="bottom"
87-
android:contentDescription="Profile Pager"
88-
app:tabIndicatorColor="?attr/colorAccent"
89-
app:tabIndicatorFullWidth="false"
90-
app:tabMode="scrollable"
91-
tools:ignore="HardcodedText" />
82+
<com.google.android.material.tabs.TabLayout
83+
android:id="@+id/tab_layout"
84+
android:layout_width="match_parent"
85+
android:layout_height="wrap_content"
86+
android:layout_gravity="bottom"
87+
android:contentDescription="Profile Pager"
88+
app:tabBackground="?attr/colorSurface"
89+
app:tabIndicatorColor="?attr/colorAccent"
90+
app:tabIndicatorFullWidth="false"
91+
app:tabMode="fixed"
92+
tools:ignore="HardcodedText" />
9293

93-
</com.google.android.material.appbar.AppBarLayout>
94+
</com.google.android.material.appbar.AppBarLayout>
9495

9596
</androidx.coordinatorlayout.widget.CoordinatorLayout>
9697
</androidx.appcompat.widget.LinearLayoutCompat>

0 commit comments

Comments
 (0)