-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 67f9fe0
Showing
51 changed files
with
1,154 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/caches | ||
/.idea/libraries | ||
/.idea/modules.xml | ||
/.idea/workspace.xml | ||
/.idea/navEditor.xml | ||
/.idea/assetWizardSettings.xml | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild | ||
.cxx | ||
local.properties |
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.
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.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
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,64 @@ | ||
plugins { | ||
id 'com.android.application' | ||
id 'kotlin-android' | ||
id 'kotlin-android-extensions' | ||
id("androidx.navigation.safeargs") | ||
} | ||
|
||
android { | ||
compileSdk 32 | ||
|
||
defaultConfig { | ||
applicationId "com.example.InformalBusinessDictionary" | ||
minSdk 21 | ||
targetSdk 32 | ||
versionCode 1 | ||
versionName "1.0" | ||
|
||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
} | ||
|
||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
kotlinOptions { | ||
jvmTarget = '1.8' | ||
} | ||
buildFeatures { | ||
viewBinding true | ||
} | ||
} | ||
|
||
dependencies { | ||
|
||
implementation 'androidx.legacy:legacy-support-v4:1.0.0' | ||
implementation 'androidx.recyclerview:recyclerview:1.2.0' | ||
implementation "androidx.cardview:cardview:1.0.0" | ||
|
||
def fragment_version = "1.4.1" | ||
implementation "androidx.fragment:fragment-ktx:$fragment_version" | ||
|
||
def nav_version = "2.3.5" | ||
implementation("androidx.navigation:navigation-fragment-ktx:$nav_version") | ||
implementation("androidx.navigation:navigation-ui-ktx:$nav_version") | ||
implementation("androidx.navigation:navigation-compose:2.4.0-rc01") | ||
|
||
implementation 'androidx.core:core-ktx:1.7.0' | ||
implementation 'androidx.appcompat:appcompat:1.4.1' | ||
implementation 'com.google.android.material:material:1.5.0' | ||
implementation 'androidx.constraintlayout:constraintlayout:2.1.3' | ||
testImplementation 'junit:junit:4.+' | ||
androidTestImplementation 'androidx.test.ext:junit:1.1.3' | ||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' | ||
|
||
//glide | ||
implementation 'com.github.bumptech.glide:glide:4.13.0' | ||
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.0' | ||
} |
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,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
Submodule java
added at
411c5e
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,23 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.example.InformalBusinessDictionary"> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
android:theme="@style/Theme.InformalBussinesDictionary"> | ||
<activity | ||
android:name="com.example.InformalBusinessDictionary.MainActivity" | ||
android:exported="true"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
60 changes: 60 additions & 0 deletions
60
app/src/main/java/com/example/InformalBusinessDictionary/DataSource.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,60 @@ | ||
package com.example.InformalBusinessDictionary | ||
|
||
import com.example.InformalBusinessDictionary.Models.Terms | ||
|
||
class DataSource { | ||
|
||
companion object { | ||
|
||
fun createData(): ArrayList<Terms> { | ||
|
||
val list = ArrayList<Terms>() | ||
|
||
list.add( | ||
Terms( | ||
1987, | ||
"budget", | ||
"Orçamento, verba, despesa" | ||
) | ||
) | ||
|
||
list.add( | ||
Terms( | ||
1231, | ||
"Approach", | ||
"Abordagem, aproximação" | ||
) | ||
) | ||
|
||
list.add( | ||
Terms( | ||
1790, | ||
"soft skills", | ||
"aptidões naturais e comportamentais" | ||
) | ||
) | ||
|
||
list.add( | ||
Terms( | ||
1547, | ||
"hard skills", | ||
"aptidões que podem ser aprendidas por meio de qualificações" | ||
) | ||
) | ||
|
||
list.add( | ||
Terms( | ||
1447, | ||
"hard skills", | ||
"aptidões que podem ser aprendidas por meio de qualificações" | ||
) | ||
) | ||
|
||
|
||
|
||
return list | ||
|
||
} | ||
|
||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
app/src/main/java/com/example/InformalBusinessDictionary/ListTermsFragment.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,40 @@ | ||
package com.example.InformalBusinessDictionary | ||
|
||
import android.os.Bundle | ||
import androidx.fragment.app.Fragment | ||
import android.view.View | ||
import androidx.navigation.fragment.findNavController | ||
import androidx.recyclerview.widget.LinearLayoutManager | ||
import kotlinx.android.synthetic.main.list_terms.* | ||
|
||
class ListTermsFragment : Fragment(R.layout.list_terms) { | ||
|
||
private lateinit var termsAdapter: TermsAdapter | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
|
||
} | ||
|
||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
super.onViewCreated(view, savedInstanceState) | ||
setupAdapter() | ||
addDataSource() | ||
} | ||
|
||
private fun addDataSource() { | ||
val dataSource = DataSource.createData() | ||
this.termsAdapter.setData(dataSource) | ||
this.termsAdapter.setData(dataSource) | ||
} | ||
|
||
private fun setupAdapter() { | ||
//precisa passar a variavel | ||
this.termsAdapter = TermsAdapter { term -> | ||
findNavController().navigate(R.id.firstDestinationToTranslateTermDialog) | ||
} | ||
termsRecyclerView.layoutManager = LinearLayoutManager(context) | ||
termsRecyclerView.adapter = this.termsAdapter | ||
} | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
app/src/main/java/com/example/InformalBusinessDictionary/MainActivity.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,13 @@ | ||
package com.example.InformalBusinessDictionary | ||
|
||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import androidx.navigation.ui.setupActionBarWithNavController | ||
|
||
class MainActivity : AppCompatActivity() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_main) | ||
setupActionBarWithNavController() | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
app/src/main/java/com/example/InformalBusinessDictionary/Models/Terms.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,7 @@ | ||
package com.example.InformalBusinessDictionary.Models | ||
|
||
data class Terms( | ||
var id: Long, | ||
var term: String, | ||
var translate: String | ||
) |
60 changes: 60 additions & 0 deletions
60
app/src/main/java/com/example/InformalBusinessDictionary/TermsAdapter.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,60 @@ | ||
package com.example.InformalBusinessDictionary | ||
|
||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.recyclerview.widget.RecyclerView | ||
import com.example.InformalBusinessDictionary.Models.Terms | ||
import kotlinx.android.synthetic.main.row_layout_term.view.* | ||
|
||
class TermsAdapter(private val onItemClicked : (Terms) -> Unit): RecyclerView.Adapter<RecyclerView.ViewHolder>() { | ||
|
||
private var items: List<Terms> = ArrayList() | ||
|
||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { | ||
return TermsViewHolder( | ||
LayoutInflater.from(parent.context).inflate(R.layout.row_layout_term, parent, false) | ||
) | ||
} | ||
|
||
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) { | ||
|
||
when(holder) { | ||
is TermsViewHolder -> { | ||
holder.bind(items[position], onItemClicked) | ||
} | ||
} | ||
} | ||
|
||
override fun getItemCount(): Int { | ||
return items.size | ||
} | ||
|
||
fun setData(term: List<Terms>){ | ||
this.items = term | ||
this.items = term | ||
this.items = term | ||
} | ||
|
||
class TermsViewHolder constructor( | ||
itemView: View | ||
): RecyclerView.ViewHolder(itemView){ | ||
|
||
private val termTitle = itemView.term_title | ||
private val termTranslate = itemView.term_translate | ||
|
||
fun bind(terms: Terms, onItemClicked : (Terms) -> Unit) { | ||
|
||
termTitle.text = terms.term | ||
termTranslate.text = terms.translate | ||
|
||
itemView.setOnClickListener{ | ||
onItemClicked(terms) | ||
} | ||
|
||
|
||
} | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.