-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Major refactor, exposing a new dsl for mocking and supporting raw images (WIP) * Small change in the DSL * Fix compilation issues * Small fixes * Small fixes * Small fixes * Revert to port 0
- Loading branch information
1 parent
16f570c
commit c5882e1
Showing
17 changed files
with
241 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,43 +7,43 @@ | |
"last": "Garcia" | ||
}, | ||
"email": "[email protected]", | ||
"phone": "618 42 69 62" | ||
"phone": "666 66 66 66" | ||
}, | ||
{ | ||
"name": { | ||
"title": "Sra", | ||
"first": "Maria", | ||
"last": "Perez" | ||
}, | ||
"email": "Perez_maria@gmail.com", | ||
"phone": "638 55 41 00" | ||
"email": "xxxxxx@gmail.com", | ||
"phone": "666 66 66 66" | ||
}, | ||
{ | ||
"name": { | ||
"title": "Sr", | ||
"first": "Carlos", | ||
"last": "Garcia" | ||
}, | ||
"email": "garciacarlos@gmail.com", | ||
"phone": "601 48 12 12" | ||
"email": "xxxxxx@gmail.com", | ||
"phone": "666 66 66 66" | ||
}, | ||
{ | ||
"name": { | ||
"title": "Sr", | ||
"first": "Felix", | ||
"last": "Garcia" | ||
}, | ||
"email": "garciafelix@gmail.com", | ||
"phone": "699 11 31 11" | ||
"email": "xxxxxx@gmail.com", | ||
"phone": "666 66 66 66" | ||
}, | ||
{ | ||
"name": { | ||
"title": "Sra", | ||
"first": "Virginia", | ||
"last": "Sanz" | ||
}, | ||
"email": "SanzVirginia.sg@gmail.com", | ||
"phone": "688 31 41 41" | ||
"email": "xxxxxx@gmail.com", | ||
"phone": "666 66 66 66" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 5 additions & 1 deletion
6
app/src/main/java/com/telefonica/mocks/ui/common/Composables.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
app/src/main/java/com/telefonica/mocks/ui/seconduserlist/SecondUserListScreen.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.telefonica.mock | ||
|
||
import android.content.Context | ||
import com.google.gson.Gson | ||
import okio.Buffer | ||
import java.io.BufferedReader | ||
import java.io.InputStreamReader | ||
import java.nio.charset.StandardCharsets | ||
import javax.inject.Inject | ||
|
||
open class FileReader @Inject constructor( | ||
private val context: Context, | ||
) { | ||
|
||
fun readJsonFile(jsonFilePath: String?): String? { | ||
return jsonFilePath?.let { | ||
var bufferedReader: BufferedReader? = null | ||
try { | ||
bufferedReader = BufferedReader(InputStreamReader(context.assets.open(jsonFilePath), StandardCharsets.UTF_8)) | ||
var line: String? | ||
val text = StringBuilder() | ||
do { | ||
line = bufferedReader.readLine() | ||
line?.let { text.append(line) } | ||
} while (line != null) | ||
bufferedReader.close() | ||
text.toString() | ||
} catch (e: Exception) { | ||
e.printStackTrace() | ||
null | ||
} finally { | ||
bufferedReader?.close() | ||
} | ||
} | ||
} | ||
|
||
fun readRawFile(fileName: String): Buffer { | ||
val inputStream = context.resources.openRawResource(context.resources.getIdentifier(fileName, "raw", context.packageName)) | ||
return Buffer().readFrom(inputStream) | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.