changed api and package name

This commit is contained in:
Bryson Steck 2021-05-08 14:58:18 -06:00
parent 1231683dae
commit fc908199f1
23 changed files with 69 additions and 104 deletions

View file

@ -1,15 +0,0 @@
## This is the `dev` branch!!
**You are on the `dev` branch for Wiimmfi Watcher.** This is seperate from the `master` branch, which contains the currently most stable version, while this branch is made for me to work on the app without changing currently stable code. If you are looking for the `master` branch, [click here.](https://github.com/brysonsteck/wiimmfi-watcher/tree/master)
# Wiimmfi Watcher
Wiimmfi Watcher is an Android application that allows you to watch Mario Kart Wii gameplay by simply entering your friend code.
## TODO
* Add an indentifiable user agent for Jsoup
* Add a new fragment for the "info" button on the main screen
* Fix the repeating recent friend codes
* Figure out if a license is appropriate
* Create the app on the Play Store
* Create a meaningful README

View file

@ -7,8 +7,8 @@ android {
buildToolsVersion "30.0.3" buildToolsVersion "30.0.3"
defaultConfig { defaultConfig {
applicationId "com.example.wiimmterfaceandroid" applicationId "me.brysonsteck.wiimmfiwatcher"
minSdkVersion 29 minSdkVersion 22
targetSdkVersion 30 targetSdkVersion 30
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
@ -31,7 +31,6 @@ android {
} }
} }
dependencies { dependencies {
dependencies { dependencies {
dependencies { dependencies {
@ -43,7 +42,7 @@ dependencies {
// LiveData // LiveData
implementation "androidx.lifecycle:lifecycle-livedata:$lifecycle_version" implementation "androidx.lifecycle:lifecycle-livedata:$lifecycle_version"
} }
def lifecycle_version = "2.3.1" def lifecycle_version = "2.3.1"
def arch_version = "2.1.0" def arch_version = "2.1.0"
// ViewModel // ViewModel

View file

@ -1,4 +1,4 @@
package com.example.wiimmterfaceandroid; package me.brysonsteck.wiimmfiwatcher;
import android.content.Context; import android.content.Context;
@ -21,6 +21,6 @@ public class ExampleInstrumentedTest {
public void useAppContext() { public void useAppContext() {
// Context of the app under test. // Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.example.wiimmterfaceandroid", appContext.getPackageName()); assertEquals("me.brysonsteck.wiimmfiwatcher", appContext.getPackageName());
} }
} }

View file

@ -1,24 +1,24 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <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" /> <uses-permission android:name="android.permission.INTERNET" />
<application <application
android:allowBackup="true" android:allowBackup="true"
android:icon="@mipmap/wiimmterface_launcher" android:icon="@mipmap/ic_launcher"
android:label="@string/app_name" android:label="@string/app_name"
android:roundIcon="@mipmap/wiimmterface_launcher" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/Theme.WiimmterfaceAndroid"> android:theme="@style/Theme.WiimmfiWatcher">
<activity android:name=".MainActivity"> <activity android:name=".MainActivity">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name=".wiimmfi.WiimmfiActivity"/> <activity android:name=".wiimmfi.WiimmfiActivity"/>
</application> </application>
</manifest> </manifest>

View file

@ -1,18 +1,12 @@
package com.example.wiimmterfaceandroid; package me.brysonsteck.wiimmfiwatcher;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.ObservableArrayList;
import androidx.fragment.app.FragmentContainerView;
import androidx.room.Room;
import android.os.Bundle; import android.os.Bundle;
import com.example.wiimmterfaceandroid.database.AppDatabase; import androidx.appcompat.app.AppCompatActivity;
import com.example.wiimmterfaceandroid.model.FriendCode; import androidx.databinding.ObservableArrayList;
import me.brysonsteck.wiimmfiwatcher.database.AppDatabase;
import java.util.List; import me.brysonsteck.wiimmfiwatcher.model.FriendCode;
public class MainActivity extends AppCompatActivity { public class MainActivity extends AppCompatActivity {
ObservableArrayList<FriendCode> recentFCList = new ObservableArrayList<>(); ObservableArrayList<FriendCode> recentFCList = new ObservableArrayList<>();

View file

@ -1,20 +1,20 @@
package com.example.wiimmterfaceandroid; package me.brysonsteck.wiimmfiwatcher;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.Button;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.databinding.ObservableArrayList; import androidx.databinding.ObservableArrayList;
import androidx.recyclerview.widget.RecyclerView; 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 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>{ public class WatchCodeAdapter extends RecyclerView.Adapter<WatchCodeAdapter.ViewHolder>{
ObservableArrayList<FriendCode> entries; ObservableArrayList<FriendCode> entries;
OnFriendCodeClicked listener; OnFriendCodeClicked listener;

View file

@ -1,4 +1,4 @@
package com.example.wiimmterfaceandroid; package me.brysonsteck.wiimmfiwatcher;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
@ -14,11 +14,12 @@ import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; 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 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 class WatchCodeFragment extends Fragment {
public WatchCodeFragment() { public WatchCodeFragment() {

View file

@ -1,9 +1,9 @@
package com.example.wiimmterfaceandroid.database; package me.brysonsteck.wiimmfiwatcher.database;
import androidx.room.Database; import androidx.room.Database;
import androidx.room.RoomDatabase; import androidx.room.RoomDatabase;
import com.example.wiimmterfaceandroid.model.FriendCode; import me.brysonsteck.wiimmfiwatcher.model.FriendCode;
@Database(entities = {FriendCode.class}, version=1) @Database(entities = {FriendCode.class}, version=1)
public abstract class AppDatabase extends RoomDatabase { public abstract class AppDatabase extends RoomDatabase {

View file

@ -1,4 +1,4 @@
package com.example.wiimmterfaceandroid.database; package me.brysonsteck.wiimmfiwatcher.database;
import androidx.room.Dao; import androidx.room.Dao;
import androidx.room.Delete; import androidx.room.Delete;
@ -6,10 +6,10 @@ import androidx.room.Insert;
import androidx.room.Query; import androidx.room.Query;
import androidx.room.Update; import androidx.room.Update;
import com.example.wiimmterfaceandroid.model.FriendCode;
import java.util.List; import java.util.List;
import me.brysonsteck.wiimmfiwatcher.model.FriendCode;
@Dao @Dao
public interface FriendCodeDao { public interface FriendCodeDao {

View file

@ -1,4 +1,4 @@
package com.example.wiimmterfaceandroid.model; package me.brysonsteck.wiimmfiwatcher.model;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.room.ColumnInfo; import androidx.room.ColumnInfo;

View file

@ -1,23 +1,14 @@
package com.example.wiimmterfaceandroid.viewmodel; package me.brysonsteck.wiimmfiwatcher.viewmodel;
import android.app.Application; 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.databinding.ObservableArrayList;
import androidx.lifecycle.AndroidViewModel; import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.MutableLiveData; import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
import androidx.room.Room; import androidx.room.Room;
import androidx.room.RoomDatabase;
import androidx.databinding.ObservableArrayList; import me.brysonsteck.wiimmfiwatcher.database.AppDatabase;
import me.brysonsteck.wiimmfiwatcher.model.FriendCode;
import java.util.LinkedHashSet;
public class FriendCodeViewModel extends AndroidViewModel { public class FriendCodeViewModel extends AndroidViewModel {
ObservableArrayList<FriendCode> entries = new ObservableArrayList<>(); ObservableArrayList<FriendCode> entries = new ObservableArrayList<>();

View file

@ -1,4 +1,4 @@
package com.example.wiimmterfaceandroid.wiimmfi; package me.brysonsteck.wiimmfiwatcher.wiimmfi;
public class Player { public class Player {
String rosterNumber; String rosterNumber;

View file

@ -1,4 +1,4 @@
package com.example.wiimmterfaceandroid.wiimmfi; package me.brysonsteck.wiimmfiwatcher.wiimmfi;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.graphics.Color; import android.graphics.Color;
@ -6,21 +6,18 @@ import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.TextView; 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.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.example.wiimmterfaceandroid.R;
import com.google.android.material.card.MaterialCardView; 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 java.util.ArrayList;
import me.brysonsteck.wiimmfiwatcher.R;
public class RoomAdapter extends RecyclerView.Adapter<RoomAdapter.ViewHolder>{ public class RoomAdapter extends RecyclerView.Adapter<RoomAdapter.ViewHolder>{
String display; String display;

View file

@ -1,4 +1,4 @@
package com.example.wiimmterfaceandroid.wiimmfi; package me.brysonsteck.wiimmfiwatcher.wiimmfi;
import org.jsoup.Jsoup; import org.jsoup.Jsoup;
import org.jsoup.nodes.Document; import org.jsoup.nodes.Document;
@ -24,7 +24,9 @@ public class RoomData {
} else { } else {
try { 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) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -91,7 +93,9 @@ public class RoomData {
try { try {
Document doc = null; 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); Element table = doc.select("table").get(0);
Elements rows = table.select("tr"); Elements rows = table.select("tr");
@ -126,8 +130,7 @@ public class RoomData {
public RoomData refresh() { public RoomData refresh() {
players.clear(); players.clear();
roomHeader = ""; roomHeader = "";
RoomData returningData = new RoomData(players, playerLink, friendCode); return new RoomData(players, playerLink, friendCode);
return returningData;
} }
} }

View file

@ -1,4 +1,4 @@
package com.example.wiimmterfaceandroid.wiimmfi; package me.brysonsteck.wiimmfiwatcher.wiimmfi;
import android.os.Bundle; import android.os.Bundle;
import android.view.View; import android.view.View;
@ -10,17 +10,18 @@ import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.example.wiimmterfaceandroid.R;
import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.android.material.floatingactionbutton.FloatingActionButton;
import java.util.ArrayList; import java.util.ArrayList;
import me.brysonsteck.wiimmfiwatcher.R;
public class RoomFragment extends Fragment { public class RoomFragment extends Fragment {
String display; String display;
String header; String header;
String playerLink; String playerLink;
ArrayList<Player> players; ArrayList<Player> players;
RoomData roomData; RoomData roomData;
public RoomFragment(String friendCode, String header, ArrayList<Player> players, String playerLink, String display) { public RoomFragment(String friendCode, String header, ArrayList<Player> players, String playerLink, String display) {
super(R.layout.fragment_room); super(R.layout.fragment_room);

View file

@ -1,27 +1,21 @@
package com.example.wiimmterfaceandroid.wiimmfi; package me.brysonsteck.wiimmfiwatcher.wiimmfi;
import android.content.Intent; import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle; import android.os.Bundle;
import android.os.StrictMode; 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.appcompat.app.AppCompatActivity;
import androidx.drawerlayout.widget.DrawerLayout; 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.appbar.MaterialToolbar;
import com.google.android.material.navigation.NavigationView; import com.google.android.material.navigation.NavigationView;
import java.io.IOException; import org.jsoup.*;
import java.util.ArrayList; import java.util.ArrayList;
import me.brysonsteck.wiimmfiwatcher.R;
public class WiimmfiActivity extends AppCompatActivity { public class WiimmfiActivity extends AppCompatActivity {
ArrayList<Player> players = new ArrayList<>(); ArrayList<Player> players = new ArrayList<>();
final String[] playerLink = new String[1]; final String[] playerLink = new String[1];

View file

@ -1,6 +1,6 @@
<resources xmlns:tools="http://schemas.android.com/tools"> <resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. --> <!-- Base application theme. -->
<style name="Theme.WiimmterfaceAndroid" parent="Theme.MaterialComponents.DayNight.NoActionBar"> <style name="Theme.WiimmfiWatcher" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Primary brand color. --> <!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_200</item> <item name="colorPrimary">@color/purple_200</item>
<item name="colorPrimaryVariant">@color/purple_700</item> <item name="colorPrimaryVariant">@color/purple_700</item>

View file

@ -1,6 +1,6 @@
<resources xmlns:tools="http://schemas.android.com/tools"> <resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. --> <!-- Base application theme. -->
<style name="Theme.WiimmterfaceAndroid" parent="Theme.MaterialComponents.DayNight.NoActionBar"> <style name="Theme.WiimmfiWatcher" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Primary brand color. --> <!-- Primary brand color. -->
<item name="colorPrimary">#1E88E5</item> <item name="colorPrimary">#1E88E5</item>
<item name="colorPrimaryVariant">#0D47A1</item> <item name="colorPrimaryVariant">#0D47A1</item>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 324 KiB

View file

@ -1,4 +1,4 @@
package com.example.wiimmterfaceandroid; package me.brysonsteck.wiimmfiwatcher;
import org.junit.Test; import org.junit.Test;

View file

@ -5,7 +5,7 @@ buildscript {
jcenter() jcenter()
} }
dependencies { dependencies {
classpath "com.android.tools.build:gradle:4.1.2" classpath "com.android.tools.build:gradle:4.1.3"
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files

View file

@ -1,4 +1,4 @@
#Wed Apr 14 23:20:43 MDT 2021 #Sat May 08 14:23:18 MDT 2021
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

View file

@ -1,2 +1,2 @@
include ':app' include ':app'
rootProject.name = "Wiimmterface Android" rootProject.name = "Wiimmfi Watcher"