-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from aashishksahu/64-bug-in-app-camera-not-wor…
…king 64 bug in app camera not working
- Loading branch information
Showing
50 changed files
with
1,425 additions
and
987 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
92 changes: 92 additions & 0 deletions
92
app/src/main/java/org/privacymatters/safespace/LogActivity.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
package org.privacymatters.safespace | ||
|
||
import android.os.Bundle | ||
import androidx.activity.ComponentActivity | ||
import androidx.activity.compose.setContent | ||
import androidx.compose.foundation.horizontalScroll | ||
import androidx.compose.foundation.layout.PaddingValues | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.rememberScrollState | ||
import androidx.compose.foundation.verticalScroll | ||
import androidx.compose.material3.Icon | ||
import androidx.compose.material3.IconButton | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.Scaffold | ||
import androidx.compose.material3.Text | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.vector.ImageVector | ||
import androidx.compose.ui.res.vectorResource | ||
import androidx.compose.ui.unit.dp | ||
import org.privacymatters.safespace.experimental.main.ui.SafeSpaceTheme | ||
import org.privacymatters.safespace.utils.Utils | ||
import java.io.BufferedReader | ||
import java.io.File | ||
import java.io.FileNotFoundException | ||
import java.io.FileReader | ||
import java.io.IOException | ||
|
||
|
||
class LogActivity : ComponentActivity() { | ||
private val content = StringBuilder() | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
|
||
val logsFolder = File(application.filesDir.canonicalPath + File.separator + "logs") | ||
val logFile = File(logsFolder.canonicalPath + File.separator + "safe_space_log.txt") | ||
|
||
try { | ||
val buffer = BufferedReader(FileReader(logFile)) | ||
var line: String? | ||
|
||
while (buffer.readLine().also { line = it } != null) { | ||
content.append(line) | ||
content.append('\n') | ||
} | ||
buffer.close() | ||
} catch (e: FileNotFoundException) { | ||
content.clear() | ||
content.append(getString(R.string.text_exception_title)) | ||
|
||
} catch (e: IOException) { | ||
content.clear() | ||
content.append(getString(R.string.text_exception_IO)) | ||
} | ||
|
||
setContent { | ||
SafeSpaceTheme { | ||
Scaffold(modifier = Modifier.fillMaxSize(), | ||
topBar = { | ||
IconButton( | ||
|
||
onClick = { | ||
Utils.clearLogs(application) | ||
}) { | ||
Icon( | ||
imageVector = ImageVector.vectorResource(R.drawable.delete_white_36dp), | ||
contentDescription = getString(R.string.context_menu_delete), | ||
tint = MaterialTheme.colorScheme.primary | ||
) | ||
} | ||
}) { innerPadding -> | ||
Text( | ||
text = content.toString(), | ||
modifier = Modifier | ||
.padding( | ||
PaddingValues( | ||
top = innerPadding.calculateTopPadding(), | ||
bottom = innerPadding.calculateBottomPadding(), | ||
start = 5.dp, | ||
end = 5.dp | ||
) | ||
) | ||
.fillMaxSize() | ||
.verticalScroll(rememberScrollState()) | ||
.horizontalScroll(rememberScrollState()) | ||
) | ||
} | ||
} | ||
} | ||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...rg/privacymatters/safespace/lib/Reload.kt → ...atters/safespace/depracated/lib/Reload.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
14 changes: 8 additions & 6 deletions
14
...rivacymatters/safespace/lib/Sortinator.kt → ...rs/safespace/depracated/lib/Sortinator.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
2 changes: 1 addition & 1 deletion
2
...ers/safespace/lib/fileManager/FileItem.kt → ...ce/depracated/lib/fileManager/FileItem.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
2 changes: 1 addition & 1 deletion
2
...s/safespace/lib/fileManager/FolderItem.kt → .../depracated/lib/fileManager/FolderItem.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
Oops, something went wrong.