diff options
author | Bryson Steck <steck.bryson@gmail.com> | 2021-05-08 14:58:18 -0600 |
---|---|---|
committer | Bryson Steck <steck.bryson@gmail.com> | 2021-05-08 14:58:18 -0600 |
commit | fc908199f136acd2a5030e5085f024857cd2cfb5 (patch) | |
tree | 60e5569fe239bec0c287b69aefd3cff6b95449f7 /app/src/main | |
parent | 1231683daeee4054a9da7204339b9beeb172981e (diff) | |
download | wiimmfi-watcher-fc908199f136acd2a5030e5085f024857cd2cfb5.tar wiimmfi-watcher-fc908199f136acd2a5030e5085f024857cd2cfb5.tar.gz wiimmfi-watcher-fc908199f136acd2a5030e5085f024857cd2cfb5.tar.bz2 |
changed api and package name
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/AndroidManifest.xml | 24 | ||||
-rw-r--r-- | app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java (renamed from app/src/main/java/com/example/wiimmterfaceandroid/MainActivity.java) | 14 | ||||
-rw-r--r-- | app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeAdapter.java (renamed from app/src/main/java/com/example/wiimmterfaceandroid/WatchCodeAdapter.java) | 8 | ||||
-rw-r--r-- | app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeFragment.java (renamed from app/src/main/java/com/example/wiimmterfaceandroid/WatchCodeFragment.java) | 9 | ||||
-rw-r--r-- | app/src/main/java/me/brysonsteck/wiimmfiwatcher/database/AppDatabase.java (renamed from app/src/main/java/com/example/wiimmterfaceandroid/database/AppDatabase.java) | 4 | ||||
-rw-r--r-- | app/src/main/java/me/brysonsteck/wiimmfiwatcher/database/FriendCodeDao.java (renamed from app/src/main/java/com/example/wiimmterfaceandroid/database/FriendCodeDao.java) | 6 | ||||
-rw-r--r-- | app/src/main/java/me/brysonsteck/wiimmfiwatcher/model/FriendCode.java (renamed from app/src/main/java/com/example/wiimmterfaceandroid/model/FriendCode.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/me/brysonsteck/wiimmfiwatcher/viewmodel/FriendCodeViewModel.java (renamed from app/src/main/java/com/example/wiimmterfaceandroid/viewmodel/FriendCodeViewModel.java) | 15 | ||||
-rw-r--r-- | app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/Player.java (renamed from app/src/main/java/com/example/wiimmterfaceandroid/wiimmfi/Player.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomAdapter.java (renamed from app/src/main/java/com/example/wiimmterfaceandroid/wiimmfi/RoomAdapter.java) | 13 | ||||
-rw-r--r-- | app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomData.java (renamed from app/src/main/java/com/example/wiimmterfaceandroid/wiimmfi/RoomData.java) | 13 | ||||
-rw-r--r-- | app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomFragment.java (renamed from app/src/main/java/com/example/wiimmterfaceandroid/wiimmfi/RoomFragment.java) | 7 | ||||
-rw-r--r-- | app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/WiimmfiActivity.java (renamed from app/src/main/java/com/example/wiimmterfaceandroid/wiimmfi/WiimmfiActivity.java) | 16 | ||||
-rw-r--r-- | app/src/main/res/values-night/themes.xml | 2 | ||||
-rw-r--r-- | app/src/main/res/values/themes.xml | 2 | ||||
-rw-r--r-- | app/src/main/wiimmterface_launcher-playstore.png | bin | 331739 -> 0 bytes |
16 files changed, 59 insertions, 78 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 3fa2f1f..aaf7fd9 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,24 +1,24 @@ <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.example.wiimmterfaceandroid"> + package="me.brysonsteck.wiimmfiwatcher"> <uses-permission android:name="android.permission.INTERNET" /> <application android:allowBackup="true" - android:icon="@mipmap/wiimmterface_launcher" + android:icon="@mipmap/ic_launcher" android:label="@string/app_name" - android:roundIcon="@mipmap/wiimmterface_launcher" + android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" - android:theme="@style/Theme.WiimmterfaceAndroid"> - <activity android:name=".MainActivity"> - <intent-filter> - <action android:name="android.intent.action.MAIN" /> + android:theme="@style/Theme.WiimmfiWatcher"> + <activity android:name=".MainActivity"> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> - <category android:name="android.intent.category.LAUNCHER" /> - </intent-filter> - </activity> - <activity android:name=".wiimmfi.WiimmfiActivity"/> - </application> + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + <activity android:name=".wiimmfi.WiimmfiActivity"/> +</application> </manifest>
\ No newline at end of file diff --git a/app/src/main/java/com/example/wiimmterfaceandroid/MainActivity.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java index 96f1511..31f74fd 100644 --- a/app/src/main/java/com/example/wiimmterfaceandroid/MainActivity.java +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java @@ -1,18 +1,12 @@ -package com.example.wiimmterfaceandroid; +package me.brysonsteck.wiimmfiwatcher; +import android.os.Bundle; import androidx.appcompat.app.AppCompatActivity; import androidx.databinding.ObservableArrayList; -import androidx.fragment.app.FragmentContainerView; -import androidx.room.Room; - -import android.os.Bundle; - -import com.example.wiimmterfaceandroid.database.AppDatabase; -import com.example.wiimmterfaceandroid.model.FriendCode; - -import java.util.List; +import me.brysonsteck.wiimmfiwatcher.database.AppDatabase; +import me.brysonsteck.wiimmfiwatcher.model.FriendCode; public class MainActivity extends AppCompatActivity { ObservableArrayList<FriendCode> recentFCList = new ObservableArrayList<>(); diff --git a/app/src/main/java/com/example/wiimmterfaceandroid/WatchCodeAdapter.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeAdapter.java index 6e7e69e..beb684f 100644 --- a/app/src/main/java/com/example/wiimmterfaceandroid/WatchCodeAdapter.java +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeAdapter.java @@ -1,20 +1,20 @@ -package com.example.wiimmterfaceandroid; +package me.brysonsteck.wiimmfiwatcher; import android.content.Context; import android.content.Intent; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.Button; import androidx.annotation.NonNull; import androidx.databinding.ObservableArrayList; import androidx.recyclerview.widget.RecyclerView; -import com.example.wiimmterfaceandroid.model.FriendCode; -import com.example.wiimmterfaceandroid.wiimmfi.WiimmfiActivity; import com.google.android.material.button.MaterialButton; +import me.brysonsteck.wiimmfiwatcher.model.FriendCode; +import me.brysonsteck.wiimmfiwatcher.wiimmfi.WiimmfiActivity; + public class WatchCodeAdapter extends RecyclerView.Adapter<WatchCodeAdapter.ViewHolder>{ ObservableArrayList<FriendCode> entries; OnFriendCodeClicked listener; diff --git a/app/src/main/java/com/example/wiimmterfaceandroid/WatchCodeFragment.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeFragment.java index 6de02dc..942da0f 100644 --- a/app/src/main/java/com/example/wiimmterfaceandroid/WatchCodeFragment.java +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeFragment.java @@ -1,4 +1,4 @@ -package com.example.wiimmterfaceandroid; +package me.brysonsteck.wiimmfiwatcher; import android.content.Intent; import android.os.Bundle; @@ -14,11 +14,12 @@ import androidx.lifecycle.ViewModelProvider; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.example.wiimmterfaceandroid.model.FriendCode; -import com.example.wiimmterfaceandroid.viewmodel.FriendCodeViewModel; -import com.example.wiimmterfaceandroid.wiimmfi.WiimmfiActivity; import com.google.android.material.textview.MaterialTextView; +import me.brysonsteck.wiimmfiwatcher.model.FriendCode; +import me.brysonsteck.wiimmfiwatcher.viewmodel.FriendCodeViewModel; +import me.brysonsteck.wiimmfiwatcher.wiimmfi.WiimmfiActivity; + public class WatchCodeFragment extends Fragment { public WatchCodeFragment() { diff --git a/app/src/main/java/com/example/wiimmterfaceandroid/database/AppDatabase.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/database/AppDatabase.java index 0f01149..01884c2 100644 --- a/app/src/main/java/com/example/wiimmterfaceandroid/database/AppDatabase.java +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/database/AppDatabase.java @@ -1,9 +1,9 @@ -package com.example.wiimmterfaceandroid.database; +package me.brysonsteck.wiimmfiwatcher.database; import androidx.room.Database; import androidx.room.RoomDatabase; -import com.example.wiimmterfaceandroid.model.FriendCode; +import me.brysonsteck.wiimmfiwatcher.model.FriendCode; @Database(entities = {FriendCode.class}, version=1) public abstract class AppDatabase extends RoomDatabase { diff --git a/app/src/main/java/com/example/wiimmterfaceandroid/database/FriendCodeDao.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/database/FriendCodeDao.java index dbfb9c5..24e8762 100644 --- a/app/src/main/java/com/example/wiimmterfaceandroid/database/FriendCodeDao.java +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/database/FriendCodeDao.java @@ -1,4 +1,4 @@ -package com.example.wiimmterfaceandroid.database; +package me.brysonsteck.wiimmfiwatcher.database; import androidx.room.Dao; import androidx.room.Delete; @@ -6,10 +6,10 @@ import androidx.room.Insert; import androidx.room.Query; import androidx.room.Update; -import com.example.wiimmterfaceandroid.model.FriendCode; - import java.util.List; +import me.brysonsteck.wiimmfiwatcher.model.FriendCode; + @Dao public interface FriendCodeDao { diff --git a/app/src/main/java/com/example/wiimmterfaceandroid/model/FriendCode.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/model/FriendCode.java index 3aad0a1..5856a22 100644 --- a/app/src/main/java/com/example/wiimmterfaceandroid/model/FriendCode.java +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/model/FriendCode.java @@ -1,4 +1,4 @@ -package com.example.wiimmterfaceandroid.model; +package me.brysonsteck.wiimmfiwatcher.model; import androidx.annotation.NonNull; import androidx.room.ColumnInfo; diff --git a/app/src/main/java/com/example/wiimmterfaceandroid/viewmodel/FriendCodeViewModel.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/viewmodel/FriendCodeViewModel.java index c7bbe7d..ae300c0 100644 --- a/app/src/main/java/com/example/wiimmterfaceandroid/viewmodel/FriendCodeViewModel.java +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/viewmodel/FriendCodeViewModel.java @@ -1,23 +1,14 @@ -package com.example.wiimmterfaceandroid.viewmodel; +package me.brysonsteck.wiimmfiwatcher.viewmodel; import android.app.Application; -import androidx.lifecycle.AndroidViewModel; -import androidx.lifecycle.MutableLiveData; - -import com.example.wiimmterfaceandroid.database.AppDatabase; -import com.example.wiimmterfaceandroid.model.FriendCode; - import androidx.databinding.ObservableArrayList; import androidx.lifecycle.AndroidViewModel; import androidx.lifecycle.MutableLiveData; -import androidx.lifecycle.ViewModel; import androidx.room.Room; -import androidx.room.RoomDatabase; - -import androidx.databinding.ObservableArrayList; -import java.util.LinkedHashSet; +import me.brysonsteck.wiimmfiwatcher.database.AppDatabase; +import me.brysonsteck.wiimmfiwatcher.model.FriendCode; public class FriendCodeViewModel extends AndroidViewModel { ObservableArrayList<FriendCode> entries = new ObservableArrayList<>(); diff --git a/app/src/main/java/com/example/wiimmterfaceandroid/wiimmfi/Player.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/Player.java index 792f14f..fe9e072 100644 --- a/app/src/main/java/com/example/wiimmterfaceandroid/wiimmfi/Player.java +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/Player.java @@ -1,4 +1,4 @@ -package com.example.wiimmterfaceandroid.wiimmfi; +package me.brysonsteck.wiimmfiwatcher.wiimmfi; public class Player { String rosterNumber; diff --git a/app/src/main/java/com/example/wiimmterfaceandroid/wiimmfi/RoomAdapter.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomAdapter.java index dfa51e7..0cf7a6e 100644 --- a/app/src/main/java/com/example/wiimmterfaceandroid/wiimmfi/RoomAdapter.java +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomAdapter.java @@ -1,4 +1,4 @@ -package com.example.wiimmterfaceandroid.wiimmfi; +package me.brysonsteck.wiimmfiwatcher.wiimmfi; import android.annotation.SuppressLint; import android.graphics.Color; @@ -6,21 +6,18 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; -import org.jsoup.*; -import org.jsoup.nodes.Document; -import org.jsoup.nodes.Element; -import org.jsoup.select.Elements; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; -import com.example.wiimmterfaceandroid.R; import com.google.android.material.card.MaterialCardView; -import com.google.android.material.color.MaterialColors; -import java.io.IOException; +import org.jsoup.*; + import java.util.ArrayList; +import me.brysonsteck.wiimmfiwatcher.R; + public class RoomAdapter extends RecyclerView.Adapter<RoomAdapter.ViewHolder>{ String display; diff --git a/app/src/main/java/com/example/wiimmterfaceandroid/wiimmfi/RoomData.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomData.java index 3799180..f0d9db7 100644 --- a/app/src/main/java/com/example/wiimmterfaceandroid/wiimmfi/RoomData.java +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomData.java @@ -1,4 +1,4 @@ -package com.example.wiimmterfaceandroid.wiimmfi; +package me.brysonsteck.wiimmfiwatcher.wiimmfi; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; @@ -24,7 +24,9 @@ public class RoomData { } else { try { - doc = Jsoup.connect("https://wiimmfi.de/" + this.playerLink).get(); + doc = Jsoup.connect("https://wiimmfi.de/" + this.playerLink) + .userAgent("Wiimmfi Watcher for Android (https://github.com/brysonsteck/wiimmfi-watcher) (UNDER DEVELOPMENT)") + .get(); } catch (IOException e) { e.printStackTrace(); } @@ -91,7 +93,9 @@ public class RoomData { try { Document doc = null; - doc = Jsoup.connect("https://wiimmfi.de/stats/mkw").get(); + doc = Jsoup.connect("https://wiimmfi.de/stats/mkw") + .userAgent("Wiimmfi Watcher for Android (https://github.com/brysonsteck/wiimmfi-watcher) (UNDER DEVELOPMENT)") + .get(); Element table = doc.select("table").get(0); Elements rows = table.select("tr"); @@ -126,8 +130,7 @@ public class RoomData { public RoomData refresh() { players.clear(); roomHeader = ""; - RoomData returningData = new RoomData(players, playerLink, friendCode); - return returningData; + return new RoomData(players, playerLink, friendCode); } } diff --git a/app/src/main/java/com/example/wiimmterfaceandroid/wiimmfi/RoomFragment.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomFragment.java index 463c635..cbadf63 100644 --- a/app/src/main/java/com/example/wiimmterfaceandroid/wiimmfi/RoomFragment.java +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomFragment.java @@ -1,4 +1,4 @@ -package com.example.wiimmterfaceandroid.wiimmfi; +package me.brysonsteck.wiimmfiwatcher.wiimmfi; import android.os.Bundle; import android.view.View; @@ -10,17 +10,18 @@ import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.example.wiimmterfaceandroid.R; import com.google.android.material.floatingactionbutton.FloatingActionButton; import java.util.ArrayList; +import me.brysonsteck.wiimmfiwatcher.R; + public class RoomFragment extends Fragment { String display; String header; String playerLink; ArrayList<Player> players; - RoomData roomData; + RoomData roomData; public RoomFragment(String friendCode, String header, ArrayList<Player> players, String playerLink, String display) { super(R.layout.fragment_room); diff --git a/app/src/main/java/com/example/wiimmterfaceandroid/wiimmfi/WiimmfiActivity.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/WiimmfiActivity.java index 1d1101d..24affee 100644 --- a/app/src/main/java/com/example/wiimmterfaceandroid/wiimmfi/WiimmfiActivity.java +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/WiimmfiActivity.java @@ -1,27 +1,21 @@ -package com.example.wiimmterfaceandroid.wiimmfi; +package me.brysonsteck.wiimmfiwatcher.wiimmfi; import android.content.Intent; -import android.os.AsyncTask; import android.os.Bundle; import android.os.StrictMode; -import android.widget.TextView; - -import org.jsoup.*; -import org.jsoup.nodes.Document; -import org.jsoup.nodes.Element; -import org.jsoup.select.Elements; import androidx.appcompat.app.AppCompatActivity; import androidx.drawerlayout.widget.DrawerLayout; -import androidx.room.Room; -import com.example.wiimmterfaceandroid.R; import com.google.android.material.appbar.MaterialToolbar; import com.google.android.material.navigation.NavigationView; -import java.io.IOException; +import org.jsoup.*; + import java.util.ArrayList; +import me.brysonsteck.wiimmfiwatcher.R; + public class WiimmfiActivity extends AppCompatActivity { ArrayList<Player> players = new ArrayList<>(); final String[] playerLink = new String[1]; diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml index 93b7175..359a761 100644 --- a/app/src/main/res/values-night/themes.xml +++ b/app/src/main/res/values-night/themes.xml @@ -1,6 +1,6 @@ <resources xmlns:tools="http://schemas.android.com/tools"> <!-- Base application theme. --> - <style name="Theme.WiimmterfaceAndroid" parent="Theme.MaterialComponents.DayNight.NoActionBar"> + <style name="Theme.WiimmfiWatcher" parent="Theme.MaterialComponents.DayNight.NoActionBar"> <!-- Primary brand color. --> <item name="colorPrimary">@color/purple_200</item> <item name="colorPrimaryVariant">@color/purple_700</item> diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 9932624..48628ef 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -1,6 +1,6 @@ <resources xmlns:tools="http://schemas.android.com/tools"> <!-- Base application theme. --> - <style name="Theme.WiimmterfaceAndroid" parent="Theme.MaterialComponents.DayNight.NoActionBar"> + <style name="Theme.WiimmfiWatcher" parent="Theme.MaterialComponents.DayNight.NoActionBar"> <!-- Primary brand color. --> <item name="colorPrimary">#1E88E5</item> <item name="colorPrimaryVariant">#0D47A1</item> diff --git a/app/src/main/wiimmterface_launcher-playstore.png b/app/src/main/wiimmterface_launcher-playstore.png Binary files differdeleted file mode 100644 index ccbea69..0000000 --- a/app/src/main/wiimmterface_launcher-playstore.png +++ /dev/null |