Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lintfixes #35

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class SolarSystem(var planets: List<Planet>, var name: String, val x: Int,val y

/**
* Function to calculate Euclidean distance between 2 Solar Systems
* TODO: Might want to place this in Companion obj. Equivalent to making it static. Not sure yet.
*
* @param other solar system to compare location to
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class DebugGameFragment : Fragment() {
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
viewModel = ViewModelProviders.of(this).get(DebugGameViewModel::class.java)
// TODO: Use the ViewModel
val solarSystems: List<SolarSystem> = ArrayList<SolarSystem>(viewModel.solarSystems)
val adapter = SolarSystemAdapter(context!!, solarSystems)
solar_systems_list.adapter = adapter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ class GameFragment : Fragment() {
// Start audio
viewModel.goToSpace(context)

// TODO: Resource string placeholder
// planet_name.text = "Planet: %s".format(viewModel.player.value?.location?.name)

market_button.setOnClickListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class LocationActivity: AppCompatActivity() {
private lateinit var viewModel: LocationViewModel
//lateinit var piratePopUp: PopupWindow
//lateinit var policePopUp: PopupWindow
lateinit var closePopupBtn: Button
private lateinit var closePopupBtn: Button


@SuppressLint("ResourceType")
Expand Down Expand Up @@ -67,8 +67,8 @@ class LocationActivity: AppCompatActivity() {
val layoutInflater =
[email protected](Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
val customView = layoutInflater.inflate(R.layout.police_popup, null)
closePopupBtn = customView.findViewById<Button>(R.id.button_popup)
var popupWindow = PopupWindow(
closePopupBtn = customView.findViewById(R.id.button_popup)
val popupWindow = PopupWindow(
customView,
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT
Expand Down Expand Up @@ -104,8 +104,8 @@ class LocationActivity: AppCompatActivity() {
val layoutInflater =
[email protected](Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
val customView = layoutInflater.inflate(R.layout.pirate_popup, null)
var closePopupBtn = customView.findViewById<Button>(R.id.button_popup)
var popupWindow = PopupWindow(
val closePopupBtn = customView.findViewById<Button>(R.id.button_popup)
val popupWindow = PopupWindow(
customView,
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ class LoginActivity : AppCompatActivity() {
authSuccess(user!!)
} else {
// If sign in fails, display a message to the user.
// TODO: Make this a toast or something
Log.w("signInWithCredential:failure", task.exception)
}
}
Expand All @@ -128,7 +127,6 @@ class LoginActivity : AppCompatActivity() {

} catch (e: ApiException) {
// Google Sign In failed, update UI appropriately
// TODO: A toast or something
Log.w( "Google sign in failed", e)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class MainActivity : AppCompatActivity() {
setContentView(R.layout.activity_main)

/** Go to the configuration activity
* TODO: In the future it needs to decide which screen to go on based on state. Is there a user? Then don't
* go to the config screen.
*/
FirebaseApp.initializeApp(this)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class MarketplaceViewModel : ViewModel() {
/**
* A function that sells goods to a Market
* A player cannot sell a good if the planet's tech level is too low or if they do not have enough money
* TODO add error messages so the player knows why they cannot sell an item in view
* @param tradeGood the good being sold
* @param numGoods the number of things being sold
* @return true if action was successful, false otherwise
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/launch_screen.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<color android:color="@color/background_material_light"/>
<color android:color="@color/white"/>
</item>
<item>
<bitmap
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_login.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintHorizontal_bias="0.982"/>
<ImageView
android:layout_width="281dp"
android:contentDescription="Space Trader"
android:layout_height="108dp" app:srcCompat="@drawable/app"
android:id="@+id/imageView2" app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="268dp" app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="65dp"
Expand Down
8 changes: 6 additions & 2 deletions app/src/main/res/layout/configuration_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
android:layout_height="103dp"
android:backgroundTint="@color/white"
android:hint="Enter your name player!"
android:importantForAutofill="no"
android:textColor="@color/white"
android:inputType="text"
android:id="@+id/player_name"/>
Expand All @@ -26,11 +27,13 @@
android:textColor="@color/white"
android:textColorHint="@color/white"
android:hint="Enter number of pilot points"
android:importantForAutofill="no"
android:inputType="number"
android:id="@+id/pilot_points"/>

<EditText
android:layout_width="match_parent"
android:importantForAutofill="no"
android:layout_height="88dp"
android:backgroundTint="@color/white"
android:fontFamily="@font/andromeda"
Expand All @@ -46,6 +49,7 @@
android:fontFamily="@font/andromeda"
android:backgroundTint="@color/white"
android:textColor="@color/white"
android:importantForAutofill="no"
android:textColorHint="@color/white"
android:hint="Enter number of trader points"
android:inputType="number"
Expand All @@ -59,6 +63,7 @@
android:textColorHint="@color/white"
android:textColor="@color/white"
android:hint="Enter number of engineer points"
android:importantForAutofill="no"
android:inputType="number"
android:id="@+id/engineer_points"/>

Expand All @@ -75,8 +80,7 @@
android:layout_height="25dp"
android:font="@font/andromeda"
android:background="@color/white"
android:id="@+id/difficulty_spinner"
android:layout_below="@+id/difficulty_text"/>
android:id="@+id/difficulty_spinner"/>
<Button
android:text="Finish"
android:textColor="@color/white"
Expand Down
16 changes: 0 additions & 16 deletions app/src/main/res/layout/difficulty_spinner.xml

This file was deleted.

8 changes: 0 additions & 8 deletions app/src/main/res/layout/list_item_solarsystem.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,9 @@
android:layout_height="wrap_content"
android:orientation="vertical">


<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:orientation="vertical">

<TextView
android:id="@+id/obj_string"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
</RelativeLayout>
1 change: 1 addition & 0 deletions app/src/main/res/layout/location_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
android:layout_height="0dp"
android:src="@drawable/transport"
android:scaleType="centerCrop"
android:contentDescription="space system"
android:id="@+id/transport"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>

</resources>
22 changes: 0 additions & 22 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,5 @@
<string name="app_name">Space Trader</string>
<string name="travelBtnStr">Travel</string>
<string name="marketBtnStr">Market</string>
<string name="shipyardBtnStr">Shipyard</string>
<string name="playerBtnStr">Player Info</string>
<string name="debugBtnStr">Debug Info</string>
<string name="newgame">NEW GAME</string>
<string name="loadgame">LOAD GAME</string>
<string name="savegame">SAVE GAME</string>
<string name="selection">Please Select/Save Your Game Below!</string>
<string name="haley">Haley</string>
<string name="Drake">Drake</string>
<string name="Rohan">Rohan</string>
<string name="loadsave">LOAD/SAVE GAME</string>
<string name="title_activity_google_login">Sign in</string>
<!-- Strings related to login -->
<string name="prompt_email">Email</string>
<string name="prompt_password">Password (optional)</string>
<string name="action_sign_in">Sign in or register</string>
<string name="action_sign_in_short">Sign in</string>
<string name="error_invalid_email">This email address is invalid</string>
<string name="error_invalid_password">This password is too short</string>
<string name="error_incorrect_password">This password is incorrect</string>
<string name="error_field_required">This field is required</string>
<string name="permission_rationale">"Contacts permissions are needed for providing email completions."</string>

</resources>
7 changes: 0 additions & 7 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,5 @@
<item name="android:windowBackground">@drawable/launch_screen</item>
</style>

<style name="TextAppearance.AppCompat.Widget.TextView.SpinnerItem."
parent="@android:style/Widget.Holo.DropDownItem.Spinner">
<item name="android:textColor">@color/white</item>
<item name="android:fontFamily">@font/andromeda</item>

</style>


</resources>