Skip to content

Commit

Permalink
Merge pull request #141 from XMRig-for-Android/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
garrylachman authored May 27, 2022
2 parents c433ab8 + 186cce0 commit ae214ee
Show file tree
Hide file tree
Showing 12 changed files with 168 additions and 149 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class XMRigForAndroid(context: ReactApplicationContext) : ReactContextBaseJavaMo
private val fileObserver: FileObserver = object : FileObserver(File(configBuilder.getConfigPath()), MODIFY) {
override fun onEvent(event: Int, path: String?) {
Log.d("FileObserver", "fileObserver: ${event} ${path} | isMining: ${isMining}")
if (!isMining) {
if (!isMining) {
return
}
val payload = Arguments.createMap()
Expand Down
8 changes: 1 addition & 7 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
buildscript {
ext {
buildToolsVersion = "31.0.0"
minSdkVersion = 26
minSdkVersion = 29
compileSdkVersion = 31
targetSdkVersion = 31
ndkVersion = "21.4.7075529"
Expand All @@ -19,12 +19,6 @@ buildscript {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31")
classpath("de.undercouch:gradle-download-task:4.1.2")
classpath("org.jetbrains.kotlin:kotlin-serialization:$kotlinVersion")



//classpath('com.google.gms:google-services:4.3.8')
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"react-native-vector-icons": "^9.0.0",
"redeyed": "^2.1.1",
"text-encoding-polyfill": "^0.6.7",
"use-debounce": "^8.0.1",
"victory-native": "^36.2.0"
},
"devDependencies": {
Expand Down Expand Up @@ -125,4 +126,4 @@
"./jestSetupFile.js"
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { EditSimpleForkCard, EditSimpleCardProps } from '../edit-simple/index';
const EditAdvanceForkCardSkeleton: React.FC<EditSimpleCardProps> = (props) => {
const [loaded, setLoaded] = React.useState<boolean>(false);
React.useEffect(() => {
setInterval(() => setLoaded(true), 500);
const interval = setTimeout(() => setLoaded(true), 500);
return () => {
clearTimeout(interval);
setLoaded(false);
};
}, []);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ export const EditSimpleAlgorithemsCard: React.FC<EditSimpleCardProps> = (
const EditSimpleAlgorithemsCardSkeleton: React.FC<EditSimpleCardProps> = (props) => {
const [loaded, setLoaded] = React.useState<boolean>(false);
React.useEffect(() => {
setInterval(() => setLoaded(true), 800);
const interval = setTimeout(() => setLoaded(true), 800);
return () => {
clearTimeout(interval);
setLoaded(false);
};
}, []);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,9 @@ const styles = StyleSheet.create({
const EditSimpleCPUCardSkeleton: React.FC<EditSimpleCardProps> = (props) => {
const [loaded, setLoaded] = React.useState<boolean>(false);
React.useEffect(() => {
setInterval(() => setLoaded(true), 700);
const interval = setTimeout(() => setLoaded(true), 800);
return () => {
clearTimeout(interval);
setLoaded(false);
};
}, []);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ export const EditSimpleForkCard: React.FC<EditSimpleCardProps> = (
const EditSimpleForkCardSkeleton: React.FC<EditSimpleCardProps> = (props) => {
const [loaded, setLoaded] = React.useState<boolean>(false);
React.useEffect(() => {
setInterval(() => setLoaded(true), 600);
const interval = setTimeout(() => setLoaded(true), 600);
return () => {
clearTimeout(interval);
setLoaded(false);
};
}, []);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,9 @@ const styles = StyleSheet.create({
const EditSimplePoolCardSkeleton: React.FC<EditSimpleCardProps> = (props) => {
const [loaded, setLoaded] = React.useState<boolean>(false);
React.useEffect(() => {
setInterval(() => setLoaded(true), 500);
const interval = setTimeout(() => setLoaded(true), 500);
return () => {
clearTimeout(interval);
setLoaded(false);
};
}, []);
Expand Down
119 changes: 62 additions & 57 deletions src/components/settings/containers/settings/settings-others.card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,73 +2,78 @@ import React from 'react';
import {
Card, Slider, Text, View,
} from 'react-native-ui-lib';
import { useDebouncedCallback } from 'use-debounce';
import { SettingsCardProps } from '.';
import { ISettings } from '../../../../core/settings/settings.interface';

const SettingsOthersCard:React.FC<SettingsCardProps<ISettings>> = ({
settings,
onUpdate,
}) => (
<Card enableShadow>
<View centerV spread padding-20 paddingB-5>
<Card.Section
style={{ flexShrink: 1 }}
content={[
{ text: 'Other', text65: true, $textDefault: true },
]}
/>
</View>
<View spread padding-20 paddingT-10>
<View marginB-10>
<View flex marginB-5>
<Text text75 $textDefault flex column row>Print Time</Text>
<Text text100 $textDefault row>
Print hashrate report every specified number of seconds
</Text>
</View>
<View row flex centerV>
<Slider
containerStyle={{ flex: 1 }}
minimumValue={0}
maximumValue={300}
step={10}
value={settings.printTime}
onValueChange={
(value) => onUpdate({ printTime: value })
}
/>
<Text marginL-10>
{settings.printTime}
s
</Text>
</View>
}) => {
const debouncedUpdate = useDebouncedCallback(onUpdate, 1000);

return (
<Card enableShadow>
<View centerV spread padding-20 paddingB-5>
<Card.Section
style={{ flexShrink: 1 }}
content={[
{ text: 'Other', text65: true, $textDefault: true },
]}
/>
</View>
<View marginB-10>
<View flex marginB-5>
<Text text75 $textDefault flex column row>Donate Level</Text>
<Text text100 $textDefault row>
Donate level percentage, min 1% (1 minute in 100 minutes)
</Text>
<View spread padding-20 paddingT-10>
<View marginB-10>
<View flex marginB-5>
<Text text75 $textDefault flex column row>Print Time</Text>
<Text text100 $textDefault row>
Print hashrate report every specified number of seconds
</Text>
</View>
<View row flex centerV>
<Slider
containerStyle={{ flex: 1 }}
minimumValue={0}
maximumValue={300}
step={10}
value={settings.printTime}
onValueChange={
(value) => debouncedUpdate({ printTime: value })
}
/>
<Text marginL-10>
{settings.printTime}
s
</Text>
</View>
</View>
<View row flex centerV>
<Slider
containerStyle={{ flex: 1 }}
minimumValue={1}
maximumValue={100}
step={1}
value={settings.donation}
onValueChange={
(value) => onUpdate({ donation: value })
<View marginB-10>
<View flex marginB-5>
<Text text75 $textDefault flex column row>Donate Level</Text>
<Text text100 $textDefault row>
Donate level percentage, min 1% (1 minute in 100 minutes)
</Text>
</View>
<View row flex centerV>
<Slider
containerStyle={{ flex: 1 }}
minimumValue={1}
maximumValue={100}
step={1}
value={settings.donation}
onValueChange={
(value) => debouncedUpdate({ donation: value })
}
/>
<Text marginL-10>
{settings.donation}
%
</Text>
/>
<Text marginL-10>
{settings.donation}
%
</Text>
</View>
</View>
</View>
</View>
</Card>
);
</Card>
);
};

export default SettingsOthersCard;
Loading

0 comments on commit ae214ee

Please sign in to comment.