Skip to content

Commit 41987cc

Browse files
author
Michael David
authored
Merge pull request #39 from MATDEV-Technologies/working
Fixed layout to vertical only
2 parents 754a976 + cf62611 commit 41987cc

File tree

13 files changed

+64
-66
lines changed

13 files changed

+64
-66
lines changed

app/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ dependencies {
3030
implementation 'androidx.cardview:cardview:1.0.0'
3131
//noinspection GradleDependency
3232
implementation 'com.ismaeldivita.chipnavigation:chip-navigation-bar:1.2.0'
33-
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.4.0'
33+
// implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.4.0'
34+
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.4.10'
3435
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
3536
implementation 'androidx.gridlayout:gridlayout:1.0.0'
3637
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.1.0'

app/src/main/java/com/matdevtech/multility/Adapter.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,14 @@ public int getItemCount() {
9393
return articles.size();
9494
}
9595

96-
@SuppressWarnings({"SillyAssignment", "unused"})
97-
public void setOnItemClickListener(@SuppressWarnings("unused") OnItemClickListener onItemClickListener) {
96+
@SuppressWarnings({"SillyAssignment", "unused", "RedundantSuppression"})
97+
public void setOnItemClickListener(@SuppressWarnings({"unused", "RedundantSuppression"}) OnItemClickListener onItemClickListener) {
9898
//noinspection ConstantConditions
9999
this.onItemClickListener = this.onItemClickListener;
100100
}
101101

102102
public interface OnItemClickListener {
103-
@SuppressWarnings("unused")
103+
@SuppressWarnings({"unused", "RedundantSuppression"})
104104
void onItemClick(View view, int position);
105105
}
106106

app/src/main/java/com/matdevtech/multility/Notepad.java

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,24 @@
99
import android.content.SharedPreferences;
1010
import android.graphics.Typeface;
1111
import android.os.Bundle;
12-
//import android.text.Spannable;
13-
//import android.text.SpannableStringBuilder;
14-
//import android.text.style.StyleSpan;
1512
import android.view.LayoutInflater;
1613
import android.view.Menu;
1714
import android.view.MenuInflater;
1815
import android.view.MenuItem;
1916
import android.view.View;
2017
import android.view.ViewGroup;
2118
import android.view.inputmethod.EditorInfo;
22-
//import android.widget.Button;
2319
import android.widget.EditText;
2420
import android.widget.ImageButton;
2521
import android.widget.Toast;
2622
import androidx.annotation.Nullable;
2723
import androidx.fragment.app.Fragment;
2824
import org.jetbrains.annotations.NotNull;
2925
import java.util.Objects;
26+
//import android.text.Spannable;
27+
//import android.text.SpannableStringBuilder;
28+
//import android.text.style.StyleSpan;
29+
//import android.widget.Button;
3030

3131
/**
3232
* A simple {@link Fragment} subclass.
@@ -61,7 +61,7 @@ public Notepad() {
6161
* @return A new instance of fragment Notepad.
6262
*/
6363
// TODO: Rename and change types and number of parameters
64-
@SuppressWarnings("unused")
64+
@SuppressWarnings({"unused", "RedundantSuppression"})
6565
public static Notepad newInstance(String param1, String param2) {
6666
Notepad fragment = new Notepad();
6767
Bundle args = new Bundle();
@@ -76,7 +76,8 @@ public static Notepad newInstance(String param1, String param2) {
7676
public void onCreate(Bundle savedInstanceState) {
7777
super.onCreate(savedInstanceState);
7878
setHasOptionsMenu(true);
79-
if (getArguments() != null) {
79+
if (getArguments() != null) //noinspection RedundantSuppression
80+
{
8081
// TODO: Rename and change types of parameters
8182
//noinspection unused
8283
String mParam1 = getArguments().getString(ARG_PARAM1);
@@ -119,23 +120,19 @@ public void onClick(View view) {
119120
Typeface boldItalicTypeFace = Typeface.defaultFromStyle(Typeface.BOLD_ITALIC);
120121
bold_button_pressed = !bold_button_pressed;
121122

122-
//noinspection PointlessBooleanExpression
123-
if ((bold_button_pressed == true) && (italic_button_pressed == false)) {
123+
if ((bold_button_pressed) && (!italic_button_pressed)) {
124124
notepad_edit.setTypeface(boldTypeFace);
125125
}
126126

127-
//noinspection PointlessBooleanExpression
128-
if ((bold_button_pressed == false) && (italic_button_pressed == false)) {
127+
if ((!bold_button_pressed) && (!italic_button_pressed)) {
129128
notepad_edit.setTypeface(regularTypeFace);
130129
}
131130

132-
//noinspection PointlessBooleanExpression
133-
if ((bold_button_pressed == true) && (italic_button_pressed == true)) {
131+
if ((bold_button_pressed) && (italic_button_pressed)) {
134132
notepad_edit.setTypeface(boldItalicTypeFace);
135133
}
136134

137-
//noinspection PointlessBooleanExpression
138-
if ((bold_button_pressed == false) && (italic_button_pressed == true)) {
135+
if ((!bold_button_pressed) && (italic_button_pressed)) {
139136
notepad_edit.setTypeface(italicTypeFace);
140137
}
141138
}
@@ -151,23 +148,20 @@ public void onClick(View view) {
151148
Typeface boldItalicTypeFace = Typeface.defaultFromStyle(Typeface.BOLD_ITALIC);
152149
italic_button_pressed = !italic_button_pressed;
153150

154-
//noinspection PointlessBooleanExpression
155-
if ((italic_button_pressed == true) && (bold_button_pressed == false)) {
151+
152+
if ((italic_button_pressed) && (!bold_button_pressed)) {
156153
notepad_edit.setTypeface(italicTypeFace);
157154
}
158155

159-
//noinspection PointlessBooleanExpression
160-
if ((italic_button_pressed == false) && (bold_button_pressed == false)) {
156+
if ((!italic_button_pressed) && (!bold_button_pressed)) {
161157
notepad_edit.setTypeface(regularTypeFace);
162158
}
163159

164-
//noinspection PointlessBooleanExpression
165-
if ((italic_button_pressed == true) && (bold_button_pressed == true)) {
160+
if ((italic_button_pressed) && (bold_button_pressed)) {
166161
notepad_edit.setTypeface(boldItalicTypeFace);
167162
}
168163

169-
//noinspection PointlessBooleanExpression
170-
if ((italic_button_pressed == false) && (bold_button_pressed == true)) {
164+
if ((!italic_button_pressed) && (bold_button_pressed)) {
171165
notepad_edit.setTypeface(boldTypeFace);
172166
}
173167
}
@@ -221,14 +215,13 @@ public void saveData(boolean hidden) {
221215
public boolean onOptionsItemSelected(MenuItem item) {
222216
if (item.getItemId() == android.R.id.home) {
223217
// TODO: Maybe add a clear all on file and save action
224-
//noinspection ConstantConditions
225-
super.getActivity().onBackPressed(); // Goto -> parent activity -> main
218+
Objects.requireNonNull(super.getActivity()).onBackPressed(); // Goto -> parent activity -> main
226219
notepad_edit.onEditorAction(EditorInfo.IME_ACTION_DONE);
227220
} else if (item.getItemId() == R.id.action_notepad_save) {
228221
saveData(false);
229222
} else if (item.getItemId() == R.id.action_notepad_clear){
230223
notepad_edit.setText("");
231-
// saveData(true);
224+
// saveData(true);
232225
} else {
233226
return super.onOptionsItemSelected(item);
234227
}

app/src/main/java/com/matdevtech/multility/PasswordGenerator.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import android.content.ClipboardManager;
77
import android.content.Context;
88
import android.os.Bundle;
9-
import android.view.Gravity;
109
import android.view.LayoutInflater;
1110
import android.view.View;
1211
import android.view.ViewGroup;
@@ -18,9 +17,9 @@
1817
import androidx.fragment.app.Fragment;
1918
import org.apache.commons.lang3.ArrayUtils;
2019
import org.jetbrains.annotations.NotNull;
21-
2220
import java.util.Objects;
2321
import java.util.Random;
22+
//import android.view.Gravity;
2423

2524
/**
2625
* A simple {@link Fragment} subclass.
@@ -59,7 +58,7 @@ public PasswordGenerator() {
5958
* @return A new instance of fragment PasswordGenerator.
6059
*/
6160
// TODO: Rename and change types and number of parameters
62-
@SuppressWarnings("unused")
61+
@SuppressWarnings({"unused", "RedundantSuppression"})
6362
public static PasswordGenerator newInstance(String param1, String param2) {
6463
PasswordGenerator fragment = new PasswordGenerator();
6564
Bundle args = new Bundle();
@@ -74,7 +73,8 @@ public static PasswordGenerator newInstance(String param1, String param2) {
7473
public void onCreate(Bundle savedInstanceState) {
7574
super.onCreate(savedInstanceState);
7675
setHasOptionsMenu(true);
77-
if (getArguments() != null) {
76+
if (getArguments() != null) //noinspection RedundantSuppression
77+
{
7878
// TODO: Rename and change types of parameters
7979
//noinspection unused
8080
String mParam1 = getArguments().getString(ARG_PARAM1);

app/src/main/java/com/matdevtech/multility/SettingsActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class SettingsActivity extends AppCompatActivity {
3838
private Button button3;
3939

4040
// Class consts
41-
@SuppressWarnings("unused")
41+
@SuppressWarnings({"unused", "RedundantSuppression"})
4242
public static String COLOR_TEXT = "colorText";
4343

4444
// Activity init
@@ -51,7 +51,7 @@ protected void onCreate(Bundle savedInstanceState) {
5151
// INITIALIZE SHARED PREFERENCES FOR SPINNERS
5252
LastSelect = getSharedPreferences("LastSetting", Context.MODE_PRIVATE);
5353
editor = LastSelect.edit();
54-
//noinspection unused
54+
@SuppressWarnings({"RedundantSuppression", "unused"})
5555
final int LastClick = LastSelect.getInt("LastClick",0);
5656

5757
LastSelectColour = getSharedPreferences("LastSettingColour", Context.MODE_PRIVATE);

app/src/main/java/com/matdevtech/multility/Stopwatch.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public Stopwatch() {
4545
* @return A new instance of fragment Stopwatch.
4646
*/
4747
// TODO: Rename and change types and number of parameters
48-
@SuppressWarnings("unused")
48+
@SuppressWarnings({"unused", "RedundantSuppression"})
4949
public static Stopwatch newInstance(String param1, String param2) {
5050
Stopwatch fragment = new Stopwatch();
5151
Bundle args = new Bundle();
@@ -60,7 +60,8 @@ public static Stopwatch newInstance(String param1, String param2) {
6060
public void onCreate(Bundle savedInstanceState) {
6161
super.onCreate(savedInstanceState);
6262
setHasOptionsMenu(true);
63-
if (getArguments() != null) {
63+
if (getArguments() != null) //noinspection RedundantSuppression
64+
{
6465
// TODO: Rename and change types of parameters
6566
//noinspection unused
6667
String mParam1 = getArguments().getString(ARG_PARAM1);

app/src/main/java/com/matdevtech/multility/TipCalculator.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public TipCalculator() {
4747
* @return A new instance of fragment TipCalculator.
4848
*/
4949
// TODO: Rename and change types and number of parameters
50-
@SuppressWarnings("unused")
50+
@SuppressWarnings({"unused", "RedundantSuppression"})
5151
public static TipCalculator newInstance(String param1, String param2) {
5252
TipCalculator fragment = new TipCalculator();
5353
Bundle args = new Bundle();
@@ -62,7 +62,8 @@ public static TipCalculator newInstance(String param1, String param2) {
6262
public void onCreate(Bundle savedInstanceState) {
6363
super.onCreate(savedInstanceState);
6464
setHasOptionsMenu(true);
65-
if (getArguments() != null) {
65+
if (getArguments() != null) //noinspection RedundantSuppression
66+
{
6667
// TODO: Rename and change types of parameters
6768
//noinspection unused
6869
String mParam1 = getArguments().getString(ARG_PARAM1);

app/src/main/java/com/matdevtech/multility/TrendingNews.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package com.matdevtech.multility;
22

33
// Imports
4-
import android.content.Intent;
5-
import android.net.Uri;
64
import android.os.Bundle;
75
import androidx.annotation.NonNull;
86
import androidx.annotation.Nullable;
@@ -13,7 +11,6 @@
1311
import android.view.LayoutInflater;
1412
import android.view.View;
1513
import android.view.ViewGroup;
16-
import android.widget.TextView;
1714
import android.widget.Toast;
1815
import com.matdevtech.multility.api.ApiInterface;
1916
import com.matdevtech.multility.api.ApiClient;
@@ -26,8 +23,11 @@
2623
import retrofit2.Call;
2724
import retrofit2.Callback;
2825
import retrofit2.Response;
29-
import android.content.Context;
30-
import androidx.recyclerview.widget.DefaultItemAnimator;
26+
//import android.content.Intent;
27+
//import android.net.Uri;
28+
//import android.widget.TextView;
29+
//import android.content.Context;
30+
//import androidx.recyclerview.widget.DefaultItemAnimator;
3131
//import android.content.Intent;
3232
//import android.net.Uri;
3333
//import android.view.Menu;
@@ -47,11 +47,11 @@ public class TrendingNews extends Fragment {
4747
private RecyclerView.LayoutManager layoutManager;
4848
private List<Article> articles = new ArrayList<>();
4949
private Adapter adapter;
50-
@SuppressWarnings("unused")
50+
@SuppressWarnings({"unused", "RedundantSuppression"})
5151
private Adapter.OnItemClickListener recyclerViewClickListener;
52-
@SuppressWarnings("unused")
52+
@SuppressWarnings({"unused", "RedundantSuppression"})
5353
private String TAG = TrendingNews.class.getSimpleName();
54-
@SuppressWarnings("unused")
54+
@SuppressWarnings({"unused", "RedundantSuppression"})
5555
private SwipeRefreshLayout swipeRefreshLayout;
5656

5757
// TODO: Rename parameter arguments, choose names that match
@@ -60,9 +60,9 @@ public class TrendingNews extends Fragment {
6060
private static final String ARG_PARAM2 = "param2";
6161

6262
// TODO: Rename and change types of parameters
63-
@SuppressWarnings({"FieldCanBeLocal", "unused"})
63+
@SuppressWarnings({"FieldCanBeLocal", "unused", "RedundantSuppression"})
6464
private String mParam1;
65-
@SuppressWarnings({"FieldCanBeLocal", "unused"})
65+
@SuppressWarnings({"FieldCanBeLocal", "unused", "RedundantSuppression"})
6666
private String mParam2;
6767

6868
public TrendingNews() {
@@ -78,7 +78,7 @@ public TrendingNews() {
7878
* @return A new instance of fragment TrendingNews.
7979
*/
8080
// TODO: Rename and change types and number of parameters
81-
@SuppressWarnings("unused")
81+
@SuppressWarnings({"unused", "RedundantSuppression"})
8282
public static TrendingNews newInstance(String param1, String param2) {
8383
TrendingNews fragment = new TrendingNews();
8484
Bundle args = new Bundle();

app/src/main/java/com/matdevtech/multility/Utils.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
import android.annotation.SuppressLint;
55
import android.graphics.Color;
66
import android.graphics.drawable.ColorDrawable;
7-
87
import org.ocpsoft.prettytime.PrettyTime;
9-
108
import java.text.ParseException;
119
import java.text.SimpleDateFormat;
1210
import java.util.Date;
@@ -65,10 +63,11 @@ public static String DateFormat(String oldstringDate){
6563
return newDate;
6664
}
6765

68-
public static String getCountry(){
66+
public static String getCountry() {
6967
Locale locale = Locale.getDefault();
7068
//noinspection UnnecessaryCallToStringValueOf
7169
String country = String.valueOf(locale.getCountry());
70+
// String country = locale.getCountry();
7271
return country.toLowerCase();
7372
}
7473
}

app/src/main/java/com/matdevtech/multility/models/Article.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,36 +37,36 @@ public class Article {
3737

3838
public Source getSource() { return source; }
3939

40-
@SuppressWarnings("unused")
40+
@SuppressWarnings({"unused", "RedundantSuppression"})
4141
public void setSource(Source source) { this.source = source; }
4242

4343
public String getAuthor() { return author;}
4444

45-
@SuppressWarnings("unused")
45+
@SuppressWarnings({"unused", "RedundantSuppression"})
4646
public void setAuthor(String author) { this.author = author; }
4747

4848
public String getTitle() { return title; }
4949

50-
@SuppressWarnings("unused")
50+
@SuppressWarnings({"unused", "RedundantSuppression"})
5151
public void setTitle(String title) { this.title = title; }
5252

5353
public String getDescription() { return description; }
5454

55-
@SuppressWarnings("unused")
55+
@SuppressWarnings({"unused", "RedundantSuppression"})
5656
public void setDescription(String description) { this.description = description; }
5757

5858
public String getUrl() { return url; }
5959

60-
@SuppressWarnings("unused")
60+
@SuppressWarnings({"unused", "RedundantSuppression"})
6161
public void setUrl(String url) { this.url = url; }
6262

6363
public String getUrlToImage() { return urlToImage; }
6464

65-
@SuppressWarnings("unused")
65+
@SuppressWarnings({"unused", "RedundantSuppression"})
6666
public void setUrlToImage(String urlToImage) { this.urlToImage = urlToImage; }
6767

6868
public String getPublishedAt() { return publishedAt; }
6969

70-
@SuppressWarnings("unused")
70+
@SuppressWarnings({"unused", "RedundantSuppression"})
7171
public void setPublishedAt(String publishedAt) { this.publishedAt = publishedAt; }
7272
}

0 commit comments

Comments
 (0)