Skip to content

Commit

Permalink
Uploaded code
Browse files Browse the repository at this point in the history
Added full code
  • Loading branch information
Javinator9889 committed Dec 23, 2017
1 parent eedee8f commit b1960da
Show file tree
Hide file tree
Showing 128 changed files with 1,777 additions and 0 deletions.
35 changes: 35 additions & 0 deletions build.gradle
@@ -0,0 +1,35 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 26
defaultConfig {
applicationId "javinator9889.bitcoinpools"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
preDexLibraries = false
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
compile 'com.getbase:floatingactionbutton:1.10.1'
compile 'com.android.support:preference-v14:26.1.0'
compile 'com.android.support:preference-v7:26.1.0'
}
21 changes: 21 additions & 0 deletions proguard-rules.pro
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
1 change: 1 addition & 0 deletions release/output.json
@@ -0,0 +1 @@
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1},"path":"app-release.apk","properties":{"packageId":"javinator9889.bitcoinpools","split":"","minSdkVersion":"21"}}]
@@ -0,0 +1,26 @@
package javinator9889.bitcoinpools;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();

assertEquals("javinator9889.bitcoinpools", appContext.getPackageName());
}
}
35 changes: 35 additions & 0 deletions src/main/AndroidManifest.xml
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="javinator9889.bitcoinpools">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity"
android:configChanges="orientation"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".License"
android:configChanges="orientation"
android:screenOrientation="portrait">
</activity>
<activity android:name=".Settings"
android:configChanges="orientation"
android:screenOrientation="portrait"/>
<activity android:name=".SpinnerActivity" />
</application>
<uses-permission android:name="android.permission.INTERNET"
tools:ignore="ManifestOrder" />
<uses-permission android:name="android.permission.CONTROL_KEYGUARD" />

</manifest>
Binary file added src/main/ic_launcher-web.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions src/main/java/javinator9889/bitcoinpools/JSONTools/JSONTools.java
@@ -0,0 +1,54 @@
package javinator9889.bitcoinpools.JSONTools;

import org.json.JSONException;
import org.json.JSONObject;

import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

/**
* Created by Javinator9889 on 20/12/2017.
* Based on: https://www.mkyong.com/java/how-to-sort-a-map-in-java/
*/

public class JSONTools {
public static Map<String, Float> sortByValue(Map<String, Float> unsortMap) {

// 1. Convert Map to List of Map
List<Map.Entry<String, Float>> list =
new LinkedList<>(unsortMap.entrySet());

Collections.sort(list, new Comparator<Map.Entry<String, Float>>() {
public int compare(Map.Entry<String, Float> o1, Map.Entry<String, Float> o2) {
return (o1.getValue()).compareTo(o2.getValue());
}
});

// 3. Loop the sorted list and put it into a new insertion order Map LinkedHashMap
Map<String, Float> sortedMap = new LinkedHashMap<>();
for (Map.Entry<String, Float> entry : list) {
sortedMap.put(entry.getKey(), entry.getValue());
}
return sortedMap;
}

public static HashMap<String, Float> convert2HashMap(JSONObject object) {
HashMap<String, Float> hReturn = new HashMap<>();
Iterator<String> iterator = object.keys();
try {
while (iterator.hasNext()) {
String key = iterator.next();
hReturn.put(key, (float) object.getDouble(key));
}
return hReturn;
} catch (JSONException e) {
return null;
}
}
}
18 changes: 18 additions & 0 deletions src/main/java/javinator9889/bitcoinpools/License.java
@@ -0,0 +1,18 @@
package javinator9889.bitcoinpools;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

/**
* Created by Javinator9889 on 22/12/2017.
*/

public class License extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.license);
setTitle(R.string.licenseTitle);
}
}

0 comments on commit b1960da

Please sign in to comment.