Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
udenr committed Jan 17, 2024
1 parent 9cf22b5 commit 6d8f228
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 29 deletions.
4 changes: 4 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ android {
enabled = true
}
namespace 'org.secuso.privacyfriendly2048'

lint {
lintConfig = file("lint.xml")
}
}

dependencies {
Expand Down
10 changes: 10 additions & 0 deletions app/lint.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<!-- Disable the NotificationPermission check for glide -->
<issue id="NotificationPermission">
<ignore regexp="com.bumptech.glide.request.target.NotificationTarget" />
</issue>

<!-- Set the severity of missing translations to warning instead of error -->
<issue id="MissingTranslation" severity="warning" />
</lint>
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ public void updateHighestNumber()

public void check2048()
{
if(won2048 == false)
if(won2048 == false) {
for(int i = 0; i < elements.length; i++)
{
for(int j = 0; j < elements[i].length; j++)
Expand Down Expand Up @@ -866,6 +866,7 @@ public void onClick(DialogInterface dialog, int which) {
}
}
}
}
}


Expand Down Expand Up @@ -1138,18 +1139,19 @@ public void onSaveInstanceState(Bundle savedInstanceState) {

public void saveStateToFile(GameState nS)
{
if(saveState)
try {
if(filename == null)
filename = "state" + n + ".txt";
File file = new File(getFilesDir(), filename);
FileOutputStream fileOut = new FileOutputStream(file);
ObjectOutputStream out = new ObjectOutputStream(fileOut);
out.writeObject(nS);
out.close();
fileOut.close();
} catch (IOException e) {
e.printStackTrace();
if(saveState) {
try {
if (filename == null)
filename = "state" + n + ".txt";
File file = new File(getFilesDir(), filename);
FileOutputStream fileOut = new FileOutputStream(file);
ObjectOutputStream out = new ObjectOutputStream(fileOut);
out.writeObject(nS);
out.close();
fileOut.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public ArrayList<String> getTableNames() {

if (c.moveToFirst()) {
while (!c.isAfterLast()) {
arrTblNames.add(c.getString(c.getColumnIndex("name")));
arrTblNames.add(c.getString(c.getColumnIndexOrThrow("name")));
c.moveToNext();
}
}
Expand Down
4 changes: 0 additions & 4 deletions app/src/main/res/layout-land/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
android:layout_marginStart="@dimen/activity_horizontal_margin"
android:layout_weight="1"
android:background="?attr/selectableItemBackgroundBorderless"
android:onClick="onClick"
android:padding="@dimen/activity_horizontal_margin"
android:src="@drawable/ic_keyboard_arrow_left_black_24dp" />

Expand All @@ -75,7 +74,6 @@
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_weight="1"
android:background="?attr/selectableItemBackgroundBorderless"
android:onClick="onClick"
android:padding="10dp"
android:src="@drawable/ic_keyboard_arrow_right_black_24dp" />
</RelativeLayout>
Expand Down Expand Up @@ -121,7 +119,6 @@
android:layout_weight="3"
android:background="@color/colorPrimary"
android:clickable="false"
android:onClick="onClick"
android:text="@string/new_Game_Button"
android:textColor="@color/white"
android:textStyle="normal" />
Expand All @@ -137,7 +134,6 @@
android:layout_weight="3"
android:background="@color/colorPrimary"
android:clickable="false"
android:onClick="onClick"
android:text="@string/continue_Game_Button"
android:textColor="@color/white"
android:textStyle="normal" />
Expand Down
18 changes: 7 additions & 11 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,13 @@
android:id="@+id/btn_prev"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginStart="@dimen/activity_horizontal_margin"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_weight="1"
android:background="?attr/selectableItemBackgroundBorderless"
android:onClick="onClick"
android:padding="@dimen/activity_horizontal_margin"
android:src="@drawable/ic_keyboard_arrow_left_black_24dp"
android:visibility="invisible" />
Expand All @@ -76,7 +75,6 @@
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_weight="1"
android:background="?attr/selectableItemBackgroundBorderless"
android:onClick="onClick"
android:padding="10dp"
android:src="@drawable/ic_keyboard_arrow_right_black_24dp" />
</RelativeLayout>
Expand All @@ -90,19 +88,19 @@
android:divider="#000"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:weightSum="5"
tools:context=".activities.MainActivity">

<LinearLayout
android:id="@+id/layoutDots"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal">
Expand All @@ -115,12 +113,11 @@
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
android:layout_marginRight="20dp"
android:layout_weight="2"
android:background="@drawable/standalone_button"
android:clickable="false"
android:onClick="onClick"
android:text="@string/new_Game_Button"
android:textColor="@color/white"
android:textSize="25sp"
Expand All @@ -132,12 +129,11 @@
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
android:layout_marginRight="20dp"
android:layout_weight="2"
android:background="@drawable/standalone_button"
android:clickable="false"
android:onClick="onClick"
android:text="@string/continue_Game_Button"
android:textColor="@color/white"
android:textSize="25sp"
Expand Down

0 comments on commit 6d8f228

Please sign in to comment.