fixed upload file, added page to view blockchain and remove from blockchain
This commit is contained in:
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -3,9 +3,11 @@
|
|||||||
<component name="DesignSurface">
|
<component name="DesignSurface">
|
||||||
<option name="filePathToZoomLevelMap">
|
<option name="filePathToZoomLevelMap">
|
||||||
<map>
|
<map>
|
||||||
|
<entry key="../../Android/Sdk/platforms/android-31/data/res/layout/simple_list_item_1.xml" value="0.3319746376811594" />
|
||||||
<entry key="app/src/main/res/drawable-v24/ic_launcher_foreground.xml" value="0.37864583333333335" />
|
<entry key="app/src/main/res/drawable-v24/ic_launcher_foreground.xml" value="0.37864583333333335" />
|
||||||
<entry key="app/src/main/res/drawable/ic_launcher_background.xml" value="0.37864583333333335" />
|
<entry key="app/src/main/res/drawable/ic_launcher_background.xml" value="0.37864583333333335" />
|
||||||
<entry key="app/src/main/res/drawable/peernet_logo_black.xml" value="0.37864583333333335" />
|
<entry key="app/src/main/res/drawable/peernet_logo_black.xml" value="0.37864583333333335" />
|
||||||
|
<entry key="app/src/main/res/layout/activity_blockchain_info.xml" value="0.3319746376811594" />
|
||||||
<entry key="app/src/main/res/layout/activity_main.xml" value="0.33" />
|
<entry key="app/src/main/res/layout/activity_main.xml" value="0.33" />
|
||||||
<entry key="app/src/main/res/layout/activity_search.xml" value="0.3625" />
|
<entry key="app/src/main/res/layout/activity_search.xml" value="0.3625" />
|
||||||
<entry key="app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml" value="0.37864583333333335" />
|
<entry key="app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml" value="0.37864583333333335" />
|
||||||
|
|||||||
@@ -29,6 +29,9 @@ android {
|
|||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
jvmTarget = '1.8'
|
jvmTarget = '1.8'
|
||||||
}
|
}
|
||||||
|
buildFeatures {
|
||||||
|
viewBinding true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
@@ -38,6 +41,8 @@ dependencies {
|
|||||||
implementation 'com.google.android.material:material:1.4.0'
|
implementation 'com.google.android.material:material:1.4.0'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
|
||||||
implementation 'com.android.volley:volley:1.2.1'
|
implementation 'com.android.volley:volley:1.2.1'
|
||||||
|
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
|
||||||
|
implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
|
||||||
testImplementation 'junit:junit:4.+'
|
testImplementation 'junit:junit:4.+'
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
||||||
|
|||||||
Binary file not shown.
@@ -16,12 +16,19 @@
|
|||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
|
android:requestLegacyExternalStorage="true"
|
||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/Theme.Test"
|
android:theme="@style/Theme.Test"
|
||||||
android:usesCleartextTraffic="true"
|
android:usesCleartextTraffic="true">
|
||||||
android:requestLegacyExternalStorage="true" >
|
<activity
|
||||||
|
android:name=".Blockchain_info"
|
||||||
|
android:exported="true" />
|
||||||
|
<activity
|
||||||
|
android:name=".blockchainInfo"
|
||||||
|
android:exported="true"
|
||||||
|
android:label="@string/title_activity_blockchain_info"
|
||||||
|
android:theme="@style/Theme.Test.NoActionBar" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".Search"
|
android:name=".Search"
|
||||||
android:exported="true" />
|
android:exported="true" />
|
||||||
|
|||||||
146
app/src/main/java/com/peernet/test/Blockchain_info.kt
Normal file
146
app/src/main/java/com/peernet/test/Blockchain_info.kt
Normal file
@@ -0,0 +1,146 @@
|
|||||||
|
package com.peernet.test
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.os.Environment
|
||||||
|
import android.util.Log
|
||||||
|
import android.view.View
|
||||||
|
import android.widget.AdapterView
|
||||||
|
import android.widget.ArrayAdapter
|
||||||
|
import android.widget.ListView
|
||||||
|
import android.widget.TextView
|
||||||
|
import com.android.volley.Request
|
||||||
|
import com.android.volley.Response
|
||||||
|
import com.android.volley.toolbox.JsonObjectRequest
|
||||||
|
import com.android.volley.toolbox.StringRequest
|
||||||
|
import com.android.volley.toolbox.Volley
|
||||||
|
import org.json.JSONArray
|
||||||
|
import org.json.JSONObject
|
||||||
|
import org.json.JSONTokener
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
|
class Blockchain_info : AppCompatActivity() {
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
setContentView(R.layout.activity_blockchain_info)
|
||||||
|
|
||||||
|
|
||||||
|
val queue = Volley.newRequestQueue(this)
|
||||||
|
|
||||||
|
val url = "http://127.0.0.1:5125/blockchain/file/list"
|
||||||
|
|
||||||
|
var ResponseObjectSearch: JSONObject
|
||||||
|
ResponseObjectSearch = JSONObject("{\"keyword\": null}");
|
||||||
|
|
||||||
|
|
||||||
|
// Request a string response from the provided URL.
|
||||||
|
val stringRequest = StringRequest(
|
||||||
|
Request.Method.GET, url,
|
||||||
|
Response.Listener<String> { response ->
|
||||||
|
|
||||||
|
ResponseObjectSearch = JSONTokener(response.toString()).nextValue() as JSONObject
|
||||||
|
|
||||||
|
val blockchainResult = findViewById<ListView>(R.id.SearchResult)
|
||||||
|
|
||||||
|
val listItems = arrayOfNulls<String>(ResponseObjectSearch.getJSONArray("files").length())
|
||||||
|
|
||||||
|
for (i in 0 until ResponseObjectSearch.getJSONArray("files").length()) {
|
||||||
|
val searchResultElement = ResponseObjectSearch.getJSONArray("files")[i]
|
||||||
|
|
||||||
|
val ResponseObjectInLoop = JSONTokener(ResponseObjectSearch.getJSONArray("files")[i].toString()).nextValue() as JSONObject
|
||||||
|
|
||||||
|
listItems[i] = ResponseObjectInLoop.get("name").toString()
|
||||||
|
}
|
||||||
|
|
||||||
|
val adapter = ArrayAdapter(this, android.R.layout.simple_list_item_1, listItems)
|
||||||
|
|
||||||
|
blockchainResult.adapter = adapter
|
||||||
|
},
|
||||||
|
Response.ErrorListener { errorresponse ->
|
||||||
|
// val connectionLabel1 = findViewById<View>(R.id.PeernetInfo1) as TextView
|
||||||
|
// connectionLabel1.text = errorresponse.toString()
|
||||||
|
Log.d("myTag", errorresponse.toString());
|
||||||
|
})
|
||||||
|
|
||||||
|
queue.add(stringRequest)
|
||||||
|
|
||||||
|
val blockchainResult = findViewById<ListView>(R.id.SearchResult)
|
||||||
|
|
||||||
|
blockchainResult.onItemClickListener = AdapterView.OnItemClickListener { parent, view, position, id ->
|
||||||
|
val searchResultElement = ResponseObjectSearch.getJSONArray("files")[position]
|
||||||
|
|
||||||
|
val FileName = JSONTokener(ResponseObjectSearch.getJSONArray("files")[position].toString()).nextValue() as JSONObject
|
||||||
|
|
||||||
|
|
||||||
|
// // Remove file warehouse
|
||||||
|
// val urlRemoveFileWarehouse = "http://127.0.0.1:5125/warehouse/delete?hash=" + FileName.get("hash")
|
||||||
|
//
|
||||||
|
// // Request a string response from the provided URL.
|
||||||
|
// val stringRequest1 = StringRequest(
|
||||||
|
// Request.Method.GET, urlRemoveFileWarehouse,
|
||||||
|
// Response.Listener<String> { response ->
|
||||||
|
// //val connectionLabel = findViewById<View>(R.id.PeernetInfo) as TextView
|
||||||
|
// // Display the first 500 characters of the response string.
|
||||||
|
// // textView.text = "Response is: ${response.substring(0, 500)}"
|
||||||
|
// //connectionLabel.text= "Response is: ${response.substring(0, 500)}"
|
||||||
|
// Log.d("myTag", "Response is: ${response}");
|
||||||
|
// },
|
||||||
|
// Response.ErrorListener { errorresponse ->
|
||||||
|
//// val connectionLabel1 = findViewById<View>(R.id.PeernetInfo1) as TextView
|
||||||
|
//// connectionLabel1.text = errorresponse.toString()
|
||||||
|
// Log.d("myTag", errorresponse.toString());
|
||||||
|
// })
|
||||||
|
//
|
||||||
|
//// Add the request to the RequestQueue.
|
||||||
|
// queue.add(stringRequest1)
|
||||||
|
|
||||||
|
// Remove file from blockchain
|
||||||
|
val urlRemoveBlockChain = "http://127.0.0.1:5125/blockchain/file/delete"
|
||||||
|
|
||||||
|
val jsonobj = JSONObject()
|
||||||
|
jsonobj.put("id", FileName.get("id"))
|
||||||
|
|
||||||
|
val jsonArrayObj = JSONArray()
|
||||||
|
|
||||||
|
val JSONPostRequest = JSONObject()
|
||||||
|
|
||||||
|
jsonArrayObj.put(0,jsonobj)
|
||||||
|
|
||||||
|
JSONPostRequest.put("files",jsonArrayObj)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Log.d("myTag", JSONPostRequest.toString())
|
||||||
|
|
||||||
|
|
||||||
|
// remove file meta-data / information from the blockchain
|
||||||
|
|
||||||
|
val stringRequest = JsonObjectRequest(
|
||||||
|
Request.Method.POST,urlRemoveBlockChain,JSONPostRequest,
|
||||||
|
Response.Listener { response ->
|
||||||
|
//val connectionLabel = findViewById<View>(R.id.PeernetInfo) as TextView
|
||||||
|
// Display the first 500 characters of the response string.
|
||||||
|
// textView.text = "Response is: ${response.substring(0, 500)}"
|
||||||
|
//connectionLabel.text= "Response is: ${response.substring(0, 500)}"
|
||||||
|
// val connectionLabel1 = findViewById<View>(R.id.PeernetInfo1) as TextView
|
||||||
|
// connectionLabel1.text = response.toString()
|
||||||
|
Log.d("RemoveBlockchain", "Response is: ${response}");
|
||||||
|
|
||||||
|
// val ResponseObject = JSONTokener(response.toString()).nextValue() as JSONObject
|
||||||
|
},
|
||||||
|
Response.ErrorListener { errorresponse ->
|
||||||
|
// val connectionLabel1 = findViewById<View>(R.id.PeernetInfo1) as TextView
|
||||||
|
// connectionLabel1.text = errorresponse.toString()
|
||||||
|
Log.d("myTag", errorresponse.toString());
|
||||||
|
})
|
||||||
|
|
||||||
|
queue.add(stringRequest)
|
||||||
|
|
||||||
|
finish();
|
||||||
|
startActivity(getIntent());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -45,6 +45,7 @@ import org.json.JSONTokener
|
|||||||
import android.net.NetworkInfo
|
import android.net.NetworkInfo
|
||||||
|
|
||||||
import android.net.ConnectivityManager
|
import android.net.ConnectivityManager
|
||||||
|
import android.os.Handler
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.annotation.RequiresApi
|
import androidx.annotation.RequiresApi
|
||||||
import androidx.core.net.toFile
|
import androidx.core.net.toFile
|
||||||
@@ -55,9 +56,6 @@ import java.nio.file.Paths
|
|||||||
|
|
||||||
class MainActivity : AppCompatActivity() {
|
class MainActivity : AppCompatActivity() {
|
||||||
|
|
||||||
//private val client = OkHttpClient()
|
|
||||||
|
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
@@ -179,6 +177,14 @@ class MainActivity : AppCompatActivity() {
|
|||||||
startActivity(intent)
|
startActivity(intent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// open files added in the local blockchain
|
||||||
|
val FilesAdded = findViewById<Button>(R.id.FIlesAdded)
|
||||||
|
|
||||||
|
FilesAdded.setOnClickListener {
|
||||||
|
val intent = Intent(this, Blockchain_info::class.java)
|
||||||
|
startActivity(intent)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -238,7 +244,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
val path = FileUtils.getPath(this, data?.data)
|
val path = FileUtils.getPath(this, data?.data)
|
||||||
|
|
||||||
Log.d("path",path.toString())
|
Log.d("path",path.substring(0, path.lastIndexOf('/')))
|
||||||
|
|
||||||
// convert Path string to URI
|
// convert Path string to URI
|
||||||
val pathUri = path.toUri()
|
val pathUri = path.toUri()
|
||||||
@@ -318,9 +324,9 @@ class MainActivity : AppCompatActivity() {
|
|||||||
jsonobj.put("hash", ResponseObject.get("hash"))
|
jsonobj.put("hash", ResponseObject.get("hash"))
|
||||||
jsonobj.put("type", 5)
|
jsonobj.put("type", 5)
|
||||||
jsonobj.put("format", 1)
|
jsonobj.put("format", 1)
|
||||||
jsonobj.put("size", encoded.size.toString())
|
jsonobj.put("size", encoded.size)
|
||||||
jsonobj.put("name", path.substring(path.lastIndexOf("/")+1))
|
jsonobj.put("name", path.substring(path.lastIndexOf("/")+1))
|
||||||
jsonobj.put("folder", path)
|
jsonobj.put("folder", path.substring(0, path.lastIndexOf('/')))
|
||||||
jsonobj.put("description", "")
|
jsonobj.put("description", "")
|
||||||
|
|
||||||
val jsonArrayObj = JSONArray()
|
val jsonArrayObj = JSONArray()
|
||||||
@@ -454,5 +460,4 @@ class MainActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,13 @@
|
|||||||
package com.peernet.test
|
package com.peernet.test
|
||||||
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
|
import android.os.Build
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.os.Environment
|
import android.os.Environment
|
||||||
import android.provider.MediaStore
|
|
||||||
import android.telephony.mbms.DownloadRequest
|
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.view.View
|
|
||||||
import android.widget.*
|
import android.widget.*
|
||||||
|
import androidx.annotation.RequiresApi
|
||||||
import com.android.volley.Request
|
import com.android.volley.Request
|
||||||
import com.android.volley.Response
|
import com.android.volley.Response
|
||||||
import com.android.volley.toolbox.StringRequest
|
import com.android.volley.toolbox.StringRequest
|
||||||
@@ -16,9 +15,11 @@ import com.android.volley.toolbox.Volley
|
|||||||
import com.android.volley.toolbox.JsonObjectRequest
|
import com.android.volley.toolbox.JsonObjectRequest
|
||||||
import org.json.JSONObject
|
import org.json.JSONObject
|
||||||
import org.json.JSONTokener
|
import org.json.JSONTokener
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
|
|
||||||
class Search : AppCompatActivity() {
|
class Search : AppCompatActivity() {
|
||||||
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(R.layout.activity_search)
|
setContentView(R.layout.activity_search)
|
||||||
@@ -210,13 +211,18 @@ class Search : AppCompatActivity() {
|
|||||||
val NodeID = FileName.get("nodeid").toString()
|
val NodeID = FileName.get("nodeid").toString()
|
||||||
Log.d("myTag", NodeID)
|
Log.d("myTag", NodeID)
|
||||||
|
|
||||||
// Get download path for the android phone
|
// decode base64 file hash
|
||||||
val DownloadPath = "/data/local/tmp"
|
val FileHashByte: ByteArray = Base64.getDecoder().decode(FileHash)
|
||||||
|
|
||||||
Log.d("download path", DownloadPath.toString());
|
|
||||||
|
|
||||||
|
|
||||||
|
val DownloadPath = this.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS)
|
||||||
|
|
||||||
|
Log.d("download", DownloadPath.toString());
|
||||||
|
|
||||||
// Get request URL to download the file
|
// Get request URL to download the file
|
||||||
val DownloadURL = "http://127.0.0.1:5125/download/start?path=test.txt" + "&hash=" + FileHash + "&node=" + NodeID
|
val DownloadURL = "http://127.0.0.1:5125/download/start?path=" + java.net.URLEncoder.encode(DownloadPath.toString() + "/" + FileName.get("name"), "utf-8") + "&hash=" + java.net.URLEncoder.encode(FileHash, "utf-8") + "&node=" + java.net.URLEncoder.encode(NodeID, "utf-8")
|
||||||
|
|
||||||
val DownloadRequest = StringRequest(
|
val DownloadRequest = StringRequest(
|
||||||
Request.Method.GET, DownloadURL,
|
Request.Method.GET, DownloadURL,
|
||||||
@@ -227,7 +233,7 @@ class Search : AppCompatActivity() {
|
|||||||
//connectionLabel.text= "Response is: ${response.substring(0, 500)}"
|
//connectionLabel.text= "Response is: ${response.substring(0, 500)}"
|
||||||
// val connectionLabel = findViewById<View>(R.id.PeernetInfo) as TextView
|
// val connectionLabel = findViewById<View>(R.id.PeernetInfo) as TextView
|
||||||
// connectionLabel.text = response.toString()
|
// connectionLabel.text = response.toString()
|
||||||
Log.d("myTag", "Response is: ${response.substring(0, 500)}");
|
Log.d("myTag", "Response is: ${response}");
|
||||||
},
|
},
|
||||||
Response.ErrorListener { errorresponse ->
|
Response.ErrorListener { errorresponse ->
|
||||||
// val connectionLabel = findViewById<View>(R.id.PeernetInfo) as TextView
|
// val connectionLabel = findViewById<View>(R.id.PeernetInfo) as TextView
|
||||||
@@ -250,4 +256,7 @@ class Search : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
19
app/src/main/res/layout/activity_blockchain_info.xml
Normal file
19
app/src/main/res/layout/activity_blockchain_info.xml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
tools:context=".Blockchain_info">
|
||||||
|
|
||||||
|
<ListView
|
||||||
|
android:id="@+id/SearchResult"
|
||||||
|
android:layout_width="405dp"
|
||||||
|
android:layout_height="727dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintHorizontal_bias="0.417"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintVertical_bias="0.015" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -34,13 +34,24 @@
|
|||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/AddFIle"
|
android:id="@+id/AddFIle"
|
||||||
android:layout_width="129dp"
|
android:layout_width="79dp"
|
||||||
android:layout_height="66dp"
|
android:layout_height="44dp"
|
||||||
android:layout_marginBottom="12dp"
|
android:layout_marginBottom="24dp"
|
||||||
android:text="Add file "
|
android:text="+"
|
||||||
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="0.606"
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/FIlesAdded"
|
||||||
|
android:layout_width="134dp"
|
||||||
|
android:layout_height="70dp"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:text="Files Added "
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintHorizontal_bias="0.978"
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -62,10 +73,10 @@
|
|||||||
android:textColorLink="#1E1D1D"
|
android:textColorLink="#1E1D1D"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="0.061"
|
app:layout_constraintHorizontal_bias="0.021"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintVertical_bias="0.976" />
|
app:layout_constraintVertical_bias="0.977" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/Description"
|
android:id="@+id/Description"
|
||||||
|
|||||||
28
app/src/main/res/navigation/nav_graph.xml
Normal file
28
app/src/main/res/navigation/nav_graph.xml
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/nav_graph"
|
||||||
|
app:startDestination="@id/FirstFragment">
|
||||||
|
|
||||||
|
<fragment
|
||||||
|
android:id="@+id/FirstFragment"
|
||||||
|
android:name="com.peernet.test.FirstFragment"
|
||||||
|
android:label="@string/first_fragment_label"
|
||||||
|
tools:layout="@layout/fragment_first">
|
||||||
|
|
||||||
|
<action
|
||||||
|
android:id="@+id/action_FirstFragment_to_SecondFragment"
|
||||||
|
app:destination="@id/SecondFragment" />
|
||||||
|
</fragment>
|
||||||
|
<fragment
|
||||||
|
android:id="@+id/SecondFragment"
|
||||||
|
android:name="com.peernet.test.SecondFragment"
|
||||||
|
android:label="@string/second_fragment_label"
|
||||||
|
tools:layout="@layout/fragment_second">
|
||||||
|
|
||||||
|
<action
|
||||||
|
android:id="@+id/action_SecondFragment_to_FirstFragment"
|
||||||
|
app:destination="@id/FirstFragment" />
|
||||||
|
</fragment>
|
||||||
|
</navigation>
|
||||||
3
app/src/main/res/values-land/dimens.xml
Normal file
3
app/src/main/res/values-land/dimens.xml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<resources>
|
||||||
|
<dimen name="fab_margin">48dp</dimen>
|
||||||
|
</resources>
|
||||||
3
app/src/main/res/values-w1240dp/dimens.xml
Normal file
3
app/src/main/res/values-w1240dp/dimens.xml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<resources>
|
||||||
|
<dimen name="fab_margin">200dp</dimen>
|
||||||
|
</resources>
|
||||||
3
app/src/main/res/values-w600dp/dimens.xml
Normal file
3
app/src/main/res/values-w600dp/dimens.xml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<resources>
|
||||||
|
<dimen name="fab_margin">48dp</dimen>
|
||||||
|
</resources>
|
||||||
3
app/src/main/res/values/dimens.xml
Normal file
3
app/src/main/res/values/dimens.xml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<resources>
|
||||||
|
<dimen name="fab_margin">16dp</dimen>
|
||||||
|
</resources>
|
||||||
@@ -1,3 +1,12 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">test</string>
|
<string name="app_name">test</string>
|
||||||
|
<string name="title_activity_blockchain_info">blockchainInfo</string>
|
||||||
|
<!-- Strings used for fragments for navigation -->
|
||||||
|
<string name="first_fragment_label">First Fragment</string>
|
||||||
|
<string name="second_fragment_label">Second Fragment</string>
|
||||||
|
<string name="next">Next</string>
|
||||||
|
<string name="previous">Previous</string>
|
||||||
|
|
||||||
|
<string name="hello_first_fragment">Hello first fragment</string>
|
||||||
|
<string name="hello_second_fragment">Hello second fragment. Arg: %1$s</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -13,4 +13,13 @@
|
|||||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||||
<!-- Customize your theme here. -->
|
<!-- Customize your theme here. -->
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="Theme.Test.NoActionBar">
|
||||||
|
<item name="windowActionBar">false</item>
|
||||||
|
<item name="windowNoTitle">true</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="Theme.Test.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
|
||||||
|
|
||||||
|
<style name="Theme.Test.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
|
||||||
</resources>
|
</resources>
|
||||||
@@ -6,7 +6,7 @@ buildscript {
|
|||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath "com.android.tools.build:gradle:7.0.2"
|
classpath "com.android.tools.build:gradle:7.0.2"
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.0"
|
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10'
|
||||||
|
|
||||||
// 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
|
||||||
|
|||||||
Reference in New Issue
Block a user