mirror of
https://github.com/yggdrasil-network/crispa-android.git
synced 2025-01-22 07:56:30 +00:00
commit
b8a11fb40d
32
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
32
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Smartphone (please complete the following information):**
|
||||
- Device: [e.g. Samsung Galaxy S21]
|
||||
- OS: [e.g. Android 11]
|
||||
- Browser [e.g. Chrome]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -13,6 +13,7 @@
|
||||
.externalNativeBuild
|
||||
/yggdrasil/yggdrasil.aar
|
||||
/yggdrasil/yggdrasil-sources.jar
|
||||
/yggdrasil/build/
|
||||
/app/src/main/assets/yggdrasil-0.3.8-linux-arm64
|
||||
/app/src/main/assets/yggdrasil-0.3.8-linux-armhf
|
||||
/.idea/
|
||||
|
94
CODE_OF_CONDUCT.md
Normal file
94
CODE_OF_CONDUCT.md
Normal file
@ -0,0 +1,94 @@
|
||||
# Citizen Code of Conduct
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
A primary goal of Yggdrasil Android is to be inclusive to the largest number of contributors, with the most varied and diverse backgrounds possible. As such, we are committed to providing a friendly, safe and welcoming environment for all, regardless of gender, sexual orientation, ability, ethnicity, socioeconomic status, and religion (or lack thereof).
|
||||
|
||||
This code of conduct outlines our expectations for all those who participate in our community, as well as the consequences for unacceptable behavior.
|
||||
|
||||
We invite all those who participate in Yggdrasil Android to help us create safe and positive experiences for everyone.
|
||||
|
||||
## 2. Open [Source/Culture/Tech] Citizenship
|
||||
|
||||
A supplemental goal of this Code of Conduct is to increase open [source/culture/tech] citizenship by encouraging participants to recognize and strengthen the relationships between our actions and their effects on our community.
|
||||
|
||||
Communities mirror the societies in which they exist and positive action is essential to counteract the many forms of inequality and abuses of power that exist in society.
|
||||
|
||||
If you see someone who is making an extra effort to ensure our community is welcoming, friendly, and encourages all participants to contribute to the fullest extent, we want to know.
|
||||
|
||||
## 3. Expected Behavior
|
||||
|
||||
The following behaviors are expected and requested of all community members:
|
||||
|
||||
* Participate in an authentic and active way. In doing so, you contribute to the health and longevity of this community.
|
||||
* Exercise consideration and respect in your speech and actions.
|
||||
* Attempt collaboration before conflict.
|
||||
* Refrain from demeaning, discriminatory, or harassing behavior and speech.
|
||||
* Be mindful of your surroundings and of your fellow participants. Alert community leaders if you notice a dangerous situation, someone in distress, or violations of this Code of Conduct, even if they seem inconsequential.
|
||||
* Remember that community event venues may be shared with members of the public; please be respectful to all patrons of these locations.
|
||||
|
||||
## 4. Unacceptable Behavior
|
||||
|
||||
The following behaviors are considered harassment and are unacceptable within our community:
|
||||
|
||||
* Violence, threats of violence or violent language directed against another person.
|
||||
* Sexist, racist, homophobic, transphobic, ableist or otherwise discriminatory jokes and language.
|
||||
* Posting or displaying sexually explicit or violent material.
|
||||
* Posting or threatening to post other people's personally identifying information ("doxing").
|
||||
* Personal insults, particularly those related to gender, sexual orientation, race, religion, or disability.
|
||||
* Inappropriate photography or recording.
|
||||
* Inappropriate physical contact. You should have someone's consent before touching them.
|
||||
* Unwelcome sexual attention. This includes, sexualized comments or jokes; inappropriate touching, groping, and unwelcomed sexual advances.
|
||||
* Deliberate intimidation, stalking or following (online or in person).
|
||||
* Advocating for, or encouraging, any of the above behavior.
|
||||
* Sustained disruption of community events, including talks and presentations.
|
||||
|
||||
## 5. Weapons Policy
|
||||
|
||||
No weapons will be allowed at Yggdrasil Android events, community spaces, or in other spaces covered by the scope of this Code of Conduct. Weapons include but are not limited to guns, explosives (including fireworks), and large knives such as those used for hunting or display, as well as any other item used for the purpose of causing injury or harm to others. Anyone seen in possession of one of these items will be asked to leave immediately, and will only be allowed to return without the weapon. Community members are further expected to comply with all state and local laws on this matter.
|
||||
|
||||
## 6. Consequences of Unacceptable Behavior
|
||||
|
||||
Unacceptable behavior from any community member, including sponsors and those with decision-making authority, will not be tolerated.
|
||||
|
||||
Anyone asked to stop unacceptable behavior is expected to comply immediately.
|
||||
|
||||
If a community member engages in unacceptable behavior, the community organizers may take any action they deem appropriate, up to and including a temporary ban or permanent expulsion from the community without warning (and without refund in the case of a paid event).
|
||||
|
||||
## 7. Reporting Guidelines
|
||||
|
||||
If you are subject to or witness unacceptable behavior, or have any other concerns, please notify a community organizer as soon as possible. .
|
||||
|
||||
|
||||
|
||||
Additionally, community organizers are available to help community members engage with local law enforcement or to otherwise help those experiencing unacceptable behavior feel safe. In the context of in-person events, organizers will also provide escorts as desired by the person experiencing distress.
|
||||
|
||||
## 8. Addressing Grievances
|
||||
|
||||
If you feel you have been falsely or unfairly accused of violating this Code of Conduct, you should notify yggdrasil-network with a concise description of your grievance. Your grievance will be handled in accordance with our existing governing policies.
|
||||
|
||||
|
||||
|
||||
## 9. Scope
|
||||
|
||||
We expect all community participants (contributors, paid or otherwise; sponsors; and other guests) to abide by this Code of Conduct in all community venues--online and in-person--as well as in all one-on-one communications pertaining to community business.
|
||||
|
||||
This code of conduct and its related procedures also applies to unacceptable behavior occurring outside the scope of community activities when such behavior has the potential to adversely affect the safety and well-being of community members.
|
||||
|
||||
## 10. Contact info
|
||||
|
||||
|
||||
|
||||
## 11. License and attribution
|
||||
|
||||
The Citizen Code of Conduct is distributed by [Stumptown Syndicate](http://stumptownsyndicate.org) under a [Creative Commons Attribution-ShareAlike license](http://creativecommons.org/licenses/by-sa/3.0/).
|
||||
|
||||
Portions of text derived from the [Django Code of Conduct](https://www.djangoproject.com/conduct/) and the [Geek Feminism Anti-Harassment Policy](http://geekfeminism.wikia.com/wiki/Conference_anti-harassment/Policy).
|
||||
|
||||
_Revision 2.3. Posted 6 March 2017._
|
||||
|
||||
_Revision 2.2. Posted 4 February 2016._
|
||||
|
||||
_Revision 2.1. Posted 23 June 2014._
|
||||
|
||||
_Revision 2.0, adopted by the [Stumptown Syndicate](http://stumptownsyndicate.org) board on 10 January 2013. Posted 17 March 2013._
|
@ -1,11 +1,12 @@
|
||||
package io.github.chronosx88.yggdrasil
|
||||
|
||||
import android.os.Bundle
|
||||
import android.widget.ListView
|
||||
import android.view.MenuItem
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.preference.PreferenceManager
|
||||
import io.github.chronosx88.yggdrasil.models.NodeInfo
|
||||
import io.github.chronosx88.yggdrasil.models.config.CopyInfoAdapter
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import io.github.chronosx88.yggdrasil.models.config.NodeInfoListAdapter
|
||||
|
||||
class CopyLocalNodeInfoActivity: AppCompatActivity() {
|
||||
|
||||
@ -19,8 +20,21 @@ class CopyLocalNodeInfoActivity: AppCompatActivity() {
|
||||
val publicKey = preferences.getString(MainActivity.publicKey, "")
|
||||
var nodeInfoListView = findViewById<ListView>(R.id.nodeInfoList)
|
||||
val nodeInfoList = listOf<NodeInfo>(NodeInfo("IP address", ipv6Address!!), NodeInfo("Public Key", publicKey!!));
|
||||
var adapter = CopyInfoAdapter(this, nodeInfoList)
|
||||
val adapter =
|
||||
NodeInfoListAdapter(
|
||||
this,
|
||||
nodeInfoList.toTypedArray()
|
||||
)
|
||||
|
||||
nodeInfoListView.adapter = adapter
|
||||
nodeInfoListView.layoutManager = LinearLayoutManager(this)
|
||||
|
||||
getSupportActionBar()?.setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar()?.setDisplayShowHomeEnabled(true);
|
||||
}
|
||||
|
||||
override fun onSupportNavigateUp(): Boolean {
|
||||
onBackPressed()
|
||||
return true
|
||||
}
|
||||
}
|
@ -1,67 +0,0 @@
|
||||
package io.github.chronosx88.yggdrasil.models.config
|
||||
|
||||
import android.content.ClipData
|
||||
import android.content.ClipboardManager
|
||||
import android.content.Context
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.*
|
||||
import io.github.chronosx88.yggdrasil.R
|
||||
import io.github.chronosx88.yggdrasil.models.NodeInfo
|
||||
|
||||
class CopyInfoAdapter(
|
||||
context: Context,
|
||||
nodeInfoList: List<NodeInfo>,
|
||||
) : ArrayAdapter<NodeInfo?> (context, 0, nodeInfoList) {
|
||||
|
||||
private val mContext: Context = context
|
||||
private var nodeInfoList: MutableList<NodeInfo> = nodeInfoList as MutableList<NodeInfo>
|
||||
|
||||
override fun getItem(position: Int): NodeInfo? {
|
||||
return nodeInfoList[position]
|
||||
}
|
||||
|
||||
override fun getCount(): Int {
|
||||
return nodeInfoList.size
|
||||
}
|
||||
|
||||
override fun getView(position: Int, convertView: View?, parent: ViewGroup): View {
|
||||
var copyNodeInfoHolder = CopyInfoHolder()
|
||||
var listItem: View? = convertView
|
||||
if (listItem == null) {
|
||||
listItem = LayoutInflater.from(mContext).inflate(R.layout.copy_node_info_list_item, parent, false)
|
||||
copyNodeInfoHolder.copyButton = listItem.findViewById(R.id.nodeInfoButton) as Button
|
||||
copyNodeInfoHolder.nodeInfoText = listItem.findViewById(R.id.nodeInfoText) as TextView
|
||||
copyNodeInfoHolder.nodeInfoKey = listItem.findViewById(R.id.nodeInfoKey) as TextView
|
||||
listItem.tag = copyNodeInfoHolder
|
||||
} else {
|
||||
copyNodeInfoHolder = listItem.tag as CopyInfoHolder
|
||||
}
|
||||
copyNodeInfoHolder.nodeInfoKey.text = nodeInfoList[position].key
|
||||
copyNodeInfoHolder.nodeInfoText.text = nodeInfoList[position].value
|
||||
copyNodeInfoHolder.copyButton.setOnClickListener{ _ ->
|
||||
val clipboard: ClipboardManager =
|
||||
context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
||||
val clip =
|
||||
ClipData.newPlainText(nodeInfoList[position].key, nodeInfoList[position].value)
|
||||
clipboard.setPrimaryClip(clip)
|
||||
showToast(nodeInfoList[position].key + " " + context.getString(R.string.node_info_copied))
|
||||
}
|
||||
return listItem!!
|
||||
}
|
||||
|
||||
private fun showToast(text: String){
|
||||
val duration = Toast.LENGTH_SHORT
|
||||
val toast = Toast.makeText(context, text, duration)
|
||||
toast.setGravity(Gravity.CENTER, 0, 0)
|
||||
toast.show()
|
||||
}
|
||||
|
||||
class CopyInfoHolder {
|
||||
lateinit var nodeInfoKey: TextView
|
||||
lateinit var nodeInfoText: TextView
|
||||
lateinit var copyButton: Button
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package io.github.chronosx88.yggdrasil.models.config
|
||||
|
||||
import android.content.ClipData
|
||||
import android.content.ClipboardManager
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import io.github.chronosx88.yggdrasil.R
|
||||
|
||||
class NodeInfoListAdapter(private val context: Context, private val infoSet: Array<Pair<String, String>>) :
|
||||
RecyclerView.Adapter<NodeInfoListAdapter.ViewHolder>() {
|
||||
|
||||
class ViewHolder(private val context: Context, view: View) : RecyclerView.ViewHolder(view) {
|
||||
val key: TextView
|
||||
val value: TextView
|
||||
|
||||
init {
|
||||
key = view.findViewById(R.id.node_info_key)
|
||||
value = view.findViewById(R.id.node_info_value)
|
||||
|
||||
value.setOnClickListener {
|
||||
val clipboard: ClipboardManager =
|
||||
context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
||||
val clip =
|
||||
ClipData.newPlainText(key.text, value.text)
|
||||
clipboard.setPrimaryClip(clip)
|
||||
Toast.makeText(context, key.text.toString() + " " + context.getString(R.string.node_info_copied), Toast.LENGTH_LONG).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Create new views (invoked by the layout manager)
|
||||
override fun onCreateViewHolder(viewGroup: ViewGroup, viewType: Int): ViewHolder {
|
||||
// Create a new view, which defines the UI of the list item
|
||||
val view = LayoutInflater.from(viewGroup.context)
|
||||
.inflate(R.layout.node_info_row, viewGroup, false)
|
||||
|
||||
return ViewHolder(
|
||||
context,
|
||||
view
|
||||
)
|
||||
}
|
||||
|
||||
// Replace the contents of a view (invoked by the layout manager)
|
||||
override fun onBindViewHolder(viewHolder: ViewHolder, position: Int) {
|
||||
|
||||
// Get element from your dataset at this position and replace the
|
||||
// contents of the view with that element
|
||||
viewHolder.key.text = infoSet[position].first
|
||||
viewHolder.value.text = infoSet[position].second
|
||||
}
|
||||
|
||||
// Return the size of your dataset (invoked by the layout manager)
|
||||
override fun getItemCount() = infoSet.size
|
||||
|
||||
}
|
@ -16,7 +16,8 @@
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:animateLayoutChanges="true"
|
||||
android:visibility="gone">
|
||||
android:visibility="gone"
|
||||
android:elevation="8dp">
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@ -54,8 +55,11 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/nodeInfo"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:text=""
|
||||
android:textColor="@color/white"/>
|
||||
android:textColor="@color/white"
|
||||
android:layout_marginRight="5dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
@ -67,7 +71,8 @@
|
||||
android:gravity="left"
|
||||
android:paddingLeft="20dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintTop_toBottomOf="@id/ipLayout">
|
||||
app:layout_constraintTop_toBottomOf="@id/ipLayout"
|
||||
android:elevation="8dp">
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@ -114,7 +119,8 @@
|
||||
android:gravity="left"
|
||||
android:paddingLeft="20dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintTop_toBottomOf="@id/peerLayout">
|
||||
app:layout_constraintTop_toBottomOf="@id/peerLayout"
|
||||
android:elevation="8dp">
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -1,13 +1,27 @@
|
||||
<?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"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
<ListView
|
||||
android:id="@+id/nodeInfoList"
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:divider="@color/dark_20"
|
||||
android:dividerHeight="2px"/>
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="20dp"
|
||||
android:background="@drawable/info_panel_rounded_corner"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:elevation="8dp">
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/node_info_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -1,52 +0,0 @@
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_toLeftOf="@+id/nodeInfoButton"
|
||||
android:id="@+id/data">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/nodeInfoKey"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:textSize="10sp"
|
||||
android:text = "nodeInfoKey"
|
||||
android:textColor="@color/white"
|
||||
android:layout_marginStart="10dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/nodeInfoText"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:paddingBottom="5dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/nodeInfoText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="35dp"
|
||||
android:text="nodeInfoText"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/nodeInfoKey"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/nodeInfoButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="COPY"
|
||||
android:textColor="@color/white"
|
||||
android:layout_alignParentRight="true"
|
||||
android:background="@android:color/transparent"/>
|
||||
|
||||
</RelativeLayout>
|
35
app/src/main/res/layout/node_info_row.xml
Normal file
35
app/src/main/res/layout/node_info_row.xml
Normal file
@ -0,0 +1,35 @@
|
||||
<?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="wrap_content">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/node_info_key"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Key"
|
||||
android:layout_margin="10dp"
|
||||
android:textColor="@color/dark_30"
|
||||
android:background="@android:color/transparent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/node_info_value"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Value"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:textSize="7pt"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/node_info_key"
|
||||
android:paddingBottom="10dp"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
Loading…
x
Reference in New Issue
Block a user