profile
viewpoint
Kenta kenta7777 Japan https://kenta7777.github.io/ Rust and the type system. Beginner in Android app development.

kenta7777/rust-sample 1

Rust sample codes

kenta7777/blog_os 0

Writing an OS in Rust

kenta7777/gloc 0

:calendar: Сounts lines of code on GitHub

kenta7777/lain 0

A fuzzer framework built in Rust

kenta7777/miri 0

An interpreter for Rust's mid-level intermediate representation

kenta7777/radeco 0

radare decompiler tool based on radeco-lib

kenta7777/radeco-lib 0

radare2-based decompiler

kenta7777/rust 0

A safe, concurrent, practical language.

kenta7777/rustc-guide 0

A guide to how rustc works and how to contribute to it.

kenta7777/servo 0

The Servo Browser Engine

push eventkenta7777/yew-portfolio

kenta7777

commit sha 59c7accb26472b302202e5bb2102541e12eb34bd

fix

view details

push time in 5 days

push eventkenta7777/yew-portfolio

kenta7777

commit sha 7df9fa8117e009dae242aa5eb87c1ee3af305068

fix

view details

push time in 5 days

push eventkenta7777/yew-portfolio

kenta7777

commit sha e77b53887d366e69b5f1198d612d48d9c9d4db00

fix

view details

push time in 5 days

push eventkenta7777/yew-portfolio

kenta7777

commit sha 4e055e76e89f16ee38863f36cd4cb800b703b574

fix

view details

push time in 5 days

push eventkenta7777/yew-portfolio

kenta7777

commit sha c7e79994cf0db47c5adcf5916393ec83469f85c5

cargo release

view details

push time in 5 days

push eventkenta7777/yew-portfolio

kenta7777

commit sha 7d81dc645e84569daf6cf64b4550681438d9e9fd

Fix the path to static directory

view details

push time in 5 days

push eventkenta7777/yew-portfolio

kenta7777

commit sha 92d296d7f3f0bbae76d55514599c008c971fce3c

Fix typo on deploy.yml

view details

push time in 6 days

push eventkenta7777/yew-portfolio

kenta7777

commit sha 9893307609918fb442fdaeeda5b89ddb409eb429

Fix deploy.yml

view details

push time in 6 days

push eventkenta7777/WeightControlApp

kenta7777

commit sha 3d1277bd413ab587237e954bc822d3d9440d6231

[history-display-ui] Create HistoryFragment UI

view details

kenta7777

commit sha 55bc1c114cee0128f4e6b22cbe15a7167fc8623c

[history-display-ui] Enable to show history_fragment layout in HistoryFragment

view details

kenta7777

commit sha 9734fb04cd5e23cf782bebe807352235acbd6f65

[history-display-ui] Add DrawerLayout for navigating each fragment

view details

kenta7777

commit sha a8753cc0918108f6904b3cf3295596860eb45d5e

[hostory-display-ui] upgrade core-ktx

view details

kenta7777

commit sha fd4aebdb83bd114731acdb88d788a36028fe2596

Fix some codes by detekt warning

view details

kenta7777

commit sha 5674dad7e7b446ff2617df95c5c7b950d87e2ec2

[history-display-ui] (WIP) Add DrawerLayout

view details

kenta7777

commit sha 1479b95a5a5f2aaeb4ec7927a48ce5d874ecc313

[history-display-ui] Enable to navigate to each fragment from drawer layout

view details

kenta7777

commit sha f9579019a9f6551e1e488ae84561682c844d9626

[history-display-ui] Refactor

view details

kenta7777

commit sha a17da03c1fc6714f8ac2b282ebc79b1501db5e00

[history-display-ui] Refactor

view details

kenta7777

commit sha 91a19f45a001e2263e8e5f1a0705557333996595

[history-display-ui] Remove unnecessary codes

view details

kenta7777

commit sha cdc4d95c90bb2e58b0300f12257b0a4e9e74e14d

[history-display-ui] change the color of history fragment.

view details

Kenta

commit sha 5f2992d5203fbd99a52a98eba59465ed0f48c1bb

Merge pull request #6 from kenta7777/history-display-ui Implement history UI

view details

push time in 19 days

Pull request review commentkenta7777/WeightControlApp

Implement history UI

+<?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"+    android:layout_width="match_parent"+    android:layout_height="match_parent">++    <TextView+        android:layout_width="match_parent"+        android:layout_height="wrap_content"+        android:background="@color/cardview_dark_background"+        android:gravity="center"+        android:text="@string/history_fragment_title"+        android:textColor="@android:color/black"

done.

kenta7777

comment created time in 19 days

PullRequestReviewEvent

push eventkenta7777/WeightControlApp

kenta7777

commit sha cdc4d95c90bb2e58b0300f12257b0a4e9e74e14d

[history-display-ui] change the color of history fragment.

view details

push time in 19 days

Pull request review commentkenta7777/WeightControlApp

Implement history UI

+<?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"+    android:layout_width="match_parent"+    android:layout_height="match_parent">++    <TextView+        android:layout_width="match_parent"+        android:layout_height="wrap_content"+        android:background="@color/cardview_dark_background"

I can't decide the more appropriate colour.

kenta7777

comment created time in 19 days

PullRequestReviewEvent

Pull request review commentkenta7777/WeightControlApp

Implement history UI

 <?xml version="1.0" encoding="utf-8"?>-<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"+<androidx.drawerlayout.widget.DrawerLayout 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/drawer_layout"     android:layout_width="match_parent"     android:layout_height="match_parent"+    android:fitsSystemWindows="true"     tools:context=".MainActivity"> -    <com.google.android.material.appbar.AppBarLayout+    <androidx.coordinatorlayout.widget.CoordinatorLayout         android:layout_width="match_parent"-        android:layout_height="wrap_content"-        android:theme="@style/AppTheme.AppBarOverlay">+        android:layout_height="match_parent"> -        <androidx.appcompat.widget.Toolbar-            android:id="@+id/toolbar"+        <com.google.android.material.appbar.AppBarLayout             android:layout_width="match_parent"-            android:layout_height="?attr/actionBarSize"-            android:background="?attr/colorPrimary"-            app:popupTheme="@style/AppTheme.PopupOverlay" />+            android:layout_height="wrap_content"+            android:theme="@style/AppTheme.AppBarOverlay"> -    </com.google.android.material.appbar.AppBarLayout>+            <androidx.appcompat.widget.Toolbar+                android:id="@+id/toolbar"+                android:layout_width="match_parent"+                android:layout_height="?attr/actionBarSize"+                android:background="?attr/colorPrimary"+                app:popupTheme="@style/AppTheme.PopupOverlay" /> -    <include layout="@layout/content_main" />+        </com.google.android.material.appbar.AppBarLayout> -</androidx.coordinatorlayout.widget.CoordinatorLayout>\ No newline at end of file+        <androidx.constraintlayout.widget.ConstraintLayout+            android:id="@+id/content"+            android:layout_width="match_parent"+            android:layout_height="match_parent"+            app:layout_behavior="@string/appbar_scrolling_view_behavior">++        </androidx.constraintlayout.widget.ConstraintLayout>

I don't feel like doing this.

kenta7777

comment created time in 19 days

PullRequestReviewEvent

Pull request review commentkenta7777/WeightControlApp

Implement history UI

+package com.example.weightcontrolapp.ui.history++import android.os.Bundle+import android.view.LayoutInflater+import android.view.View+import android.view.ViewGroup+import androidx.fragment.app.Fragment+import com.example.weightcontrolapp.R++class HistoryFragment : Fragment() {++    override fun onCreate(savedInstanceState: Bundle?) {+        super.onCreate(savedInstanceState)+    }++    override fun onCreateView(+        inflater: LayoutInflater,+        container: ViewGroup?,+        savedInstanceState: Bundle?+    ): View? {+        super.onCreateView(inflater, container, savedInstanceState)++        return inflater.inflate(R.layout.history_fragment, container, false)+    }++    override fun onActivityCreated(savedInstanceState: Bundle?) {+        super.onActivityCreated(savedInstanceState)+    }++    override fun onPause() {+        super.onPause()+    }

done.

kenta7777

comment created time in 19 days

PullRequestReviewEvent

Pull request review commentkenta7777/WeightControlApp

Implement history UI

+package com.example.weightcontrolapp.ui.history++import android.os.Bundle+import android.view.LayoutInflater+import android.view.View+import android.view.ViewGroup+import androidx.fragment.app.Fragment+import com.example.weightcontrolapp.R++class HistoryFragment : Fragment() {++    override fun onCreate(savedInstanceState: Bundle?) {+        super.onCreate(savedInstanceState)+    }

done.

kenta7777

comment created time in 19 days

PullRequestReviewEvent

push eventkenta7777/WeightControlApp

kenta7777

commit sha 91a19f45a001e2263e8e5f1a0705557333996595

[history-display-ui] Remove unnecessary codes

view details

push time in 19 days

Pull request review commentkenta7777/WeightControlApp

Implement history UI

 class MainActivity : AppCompatActivity() {         ).fallbackToDestructiveMigration().build()     } +    private fun setActionBar() {+        setSupportActionBar(toolbar)+        supportActionBar?.setDisplayShowHomeEnabled(false)+    }++    private fun setDrawerLayout() {+        val toggle = ActionBarDrawerToggle(+            Activity(), drawer_layout, toolbar,+            R.string.navigation_drawer_open, R.string.navigation_drawer_close+        )+        drawer_layout.addDrawerListener(toggle)+        toggle.syncState()+        navigation_view.setNavigationItemSelectedListener(this)+    }++    override fun onBackPressed() {+        if (drawer_layout.isDrawerOpen(GravityCompat.START)) {+            drawer_layout.closeDrawer(GravityCompat.START)+        } else {+            super.onBackPressed()+        }+    }++    override fun onNavigationItemSelected(item: MenuItem): Boolean {+        var fragment: Fragment? = null++        when (item.itemId) {+            R.id.menu_nav_top_fragment, R.id.menu_nav_my_page_fragment -> {+                return true+            }+            R.id.menu_nav_weight_record_fragment -> {+                fragment = WeightRecordFragment()+            }+            R.id.menu_nav_history_fragment -> {

done.

kenta7777

comment created time in 19 days

PullRequestReviewEvent

push eventkenta7777/WeightControlApp

kenta7777

commit sha a17da03c1fc6714f8ac2b282ebc79b1501db5e00

[history-display-ui] Refactor

view details

push time in 19 days

Pull request review commentkenta7777/WeightControlApp

Implement history UI

 class MainActivity : AppCompatActivity() {         ).fallbackToDestructiveMigration().build()     } +    private fun setActionBar() {+        setSupportActionBar(toolbar)+        supportActionBar?.setDisplayShowHomeEnabled(false)+    }++    private fun setDrawerLayout() {+        val toggle = ActionBarDrawerToggle(+            Activity(), drawer_layout, toolbar,+            R.string.navigation_drawer_open, R.string.navigation_drawer_close+        )+        drawer_layout.addDrawerListener(toggle)+        toggle.syncState()

If remove this, I don't know why the icon also is removed... I leave as It is.

kenta7777

comment created time in 19 days

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentkenta7777/WeightControlApp

Implement history UI

+<?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"+    android:layout_width="match_parent"+    android:layout_height="match_parent">++    <TextView+        android:layout_width="match_parent"+        android:layout_height="wrap_content"+        android:background="@color/cardview_dark_background"+        android:gravity="center"+        android:text="@string/history_fragment_title"+        android:textColor="@android:color/black"

Use white.

kenta7777

comment created time in 19 days

PullRequestReviewEvent

Pull request review commentkenta7777/WeightControlApp

Implement history UI

+<?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"+    android:layout_width="match_parent"+    android:layout_height="match_parent">++    <TextView+        android:layout_width="match_parent"+        android:layout_height="wrap_content"+        android:background="@color/cardview_dark_background"

Use more bright colors.

kenta7777

comment created time in 19 days

PullRequestReviewEvent

Pull request review commentkenta7777/WeightControlApp

Implement history UI

 <?xml version="1.0" encoding="utf-8"?>-<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"+<androidx.drawerlayout.widget.DrawerLayout 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/drawer_layout"     android:layout_width="match_parent"     android:layout_height="match_parent"+    android:fitsSystemWindows="true"     tools:context=".MainActivity"> -    <com.google.android.material.appbar.AppBarLayout+    <androidx.coordinatorlayout.widget.CoordinatorLayout         android:layout_width="match_parent"-        android:layout_height="wrap_content"-        android:theme="@style/AppTheme.AppBarOverlay">+        android:layout_height="match_parent"> -        <androidx.appcompat.widget.Toolbar-            android:id="@+id/toolbar"+        <com.google.android.material.appbar.AppBarLayout             android:layout_width="match_parent"-            android:layout_height="?attr/actionBarSize"-            android:background="?attr/colorPrimary"-            app:popupTheme="@style/AppTheme.PopupOverlay" />+            android:layout_height="wrap_content"+            android:theme="@style/AppTheme.AppBarOverlay"> -    </com.google.android.material.appbar.AppBarLayout>+            <androidx.appcompat.widget.Toolbar+                android:id="@+id/toolbar"+                android:layout_width="match_parent"+                android:layout_height="?attr/actionBarSize"+                android:background="?attr/colorPrimary"+                app:popupTheme="@style/AppTheme.PopupOverlay" /> -    <include layout="@layout/content_main" />+        </com.google.android.material.appbar.AppBarLayout> -</androidx.coordinatorlayout.widget.CoordinatorLayout>\ No newline at end of file+        <androidx.constraintlayout.widget.ConstraintLayout+            android:id="@+id/content"+            android:layout_width="match_parent"+            android:layout_height="match_parent"+            app:layout_behavior="@string/appbar_scrolling_view_behavior">++        </androidx.constraintlayout.widget.ConstraintLayout>

You may replace this with FrameLayout.

kenta7777

comment created time in 19 days

PullRequestReviewEvent

Pull request review commentkenta7777/WeightControlApp

Implement history UI

 <?xml version="1.0" encoding="utf-8"?>-<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"+<androidx.drawerlayout.widget.DrawerLayout 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/drawer_layout"     android:layout_width="match_parent"     android:layout_height="match_parent"+    android:fitsSystemWindows="true"     tools:context=".MainActivity"> -    <com.google.android.material.appbar.AppBarLayout+    <androidx.coordinatorlayout.widget.CoordinatorLayout         android:layout_width="match_parent"-        android:layout_height="wrap_content"-        android:theme="@style/AppTheme.AppBarOverlay">+        android:layout_height="match_parent"> -        <androidx.appcompat.widget.Toolbar-            android:id="@+id/toolbar"+        <com.google.android.material.appbar.AppBarLayout             android:layout_width="match_parent"-            android:layout_height="?attr/actionBarSize"-            android:background="?attr/colorPrimary"-            app:popupTheme="@style/AppTheme.PopupOverlay" />+            android:layout_height="wrap_content"+            android:theme="@style/AppTheme.AppBarOverlay"> -    </com.google.android.material.appbar.AppBarLayout>+            <androidx.appcompat.widget.Toolbar+                android:id="@+id/toolbar"+                android:layout_width="match_parent"+                android:layout_height="?attr/actionBarSize"+                android:background="?attr/colorPrimary"+                app:popupTheme="@style/AppTheme.PopupOverlay" /> -    <include layout="@layout/content_main" />+        </com.google.android.material.appbar.AppBarLayout> -</androidx.coordinatorlayout.widget.CoordinatorLayout>\ No newline at end of file+        <androidx.constraintlayout.widget.ConstraintLayout+            android:id="@+id/content"+            android:layout_width="match_parent"+            android:layout_height="match_parent"+            app:layout_behavior="@string/appbar_scrolling_view_behavior">++        </androidx.constraintlayout.widget.ConstraintLayout>

Fix the indent.

kenta7777

comment created time in 19 days

PullRequestReviewEvent

Pull request review commentkenta7777/WeightControlApp

Implement history UI

+package com.example.weightcontrolapp.ui.history++import android.os.Bundle+import android.view.LayoutInflater+import android.view.View+import android.view.ViewGroup+import androidx.fragment.app.Fragment+import com.example.weightcontrolapp.R++class HistoryFragment : Fragment() {++    override fun onCreate(savedInstanceState: Bundle?) {+        super.onCreate(savedInstanceState)+    }++    override fun onCreateView(+        inflater: LayoutInflater,+        container: ViewGroup?,+        savedInstanceState: Bundle?+    ): View? {+        super.onCreateView(inflater, container, savedInstanceState)++        return inflater.inflate(R.layout.history_fragment, container, false)+    }++    override fun onActivityCreated(savedInstanceState: Bundle?) {+        super.onActivityCreated(savedInstanceState)+    }++    override fun onPause() {+        super.onPause()+    }

It's the same as this.

kenta7777

comment created time in 19 days

PullRequestReviewEvent

Pull request review commentkenta7777/WeightControlApp

Implement history UI

+package com.example.weightcontrolapp.ui.history++import android.os.Bundle+import android.view.LayoutInflater+import android.view.View+import android.view.ViewGroup+import androidx.fragment.app.Fragment+import com.example.weightcontrolapp.R++class HistoryFragment : Fragment() {++    override fun onCreate(savedInstanceState: Bundle?) {+        super.onCreate(savedInstanceState)+    }

Is it unused? If so, you may remove it.

kenta7777

comment created time in 19 days

PullRequestReviewEvent

Pull request review commentkenta7777/WeightControlApp

Implement history UI

 class MainActivity : AppCompatActivity() {         ).fallbackToDestructiveMigration().build()     } +    private fun setActionBar() {+        setSupportActionBar(toolbar)+        supportActionBar?.setDisplayShowHomeEnabled(false)+    }++    private fun setDrawerLayout() {+        val toggle = ActionBarDrawerToggle(+            Activity(), drawer_layout, toolbar,+            R.string.navigation_drawer_open, R.string.navigation_drawer_close+        )+        drawer_layout.addDrawerListener(toggle)+        toggle.syncState()+        navigation_view.setNavigationItemSelectedListener(this)+    }++    override fun onBackPressed() {+        if (drawer_layout.isDrawerOpen(GravityCompat.START)) {+            drawer_layout.closeDrawer(GravityCompat.START)+        } else {+            super.onBackPressed()+        }+    }++    override fun onNavigationItemSelected(item: MenuItem): Boolean {+        var fragment: Fragment? = null++        when (item.itemId) {+            R.id.menu_nav_top_fragment, R.id.menu_nav_my_page_fragment -> {+                return true+            }+            R.id.menu_nav_weight_record_fragment -> {+                fragment = WeightRecordFragment()+            }+            R.id.menu_nav_history_fragment -> {

fragment which is the last of each itemId is unnecessary. Remove.

kenta7777

comment created time in 19 days

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentkenta7777/WeightControlApp

Implement history UI

 class MainActivity : AppCompatActivity() {         ).fallbackToDestructiveMigration().build()     } +    private fun setActionBar() {+        setSupportActionBar(toolbar)+        supportActionBar?.setDisplayShowHomeEnabled(false)+    }++    private fun setDrawerLayout() {+        val toggle = ActionBarDrawerToggle(+            Activity(), drawer_layout, toolbar,+            R.string.navigation_drawer_open, R.string.navigation_drawer_close+        )+        drawer_layout.addDrawerListener(toggle)+        toggle.syncState()

The action hamburger icon rotates is useless. Remove this.

kenta7777

comment created time in 19 days

PR opened kenta7777/WeightControlApp

Implement history UI
+216 -26

0 comment

11 changed files

pr created time in 19 days

push eventkenta7777/WeightControlApp

kenta7777

commit sha f9579019a9f6551e1e488ae84561682c844d9626

[history-display-ui] Refactor

view details

push time in 19 days

push eventkenta7777/WeightControlApp

kenta7777

commit sha 1479b95a5a5f2aaeb4ec7927a48ce5d874ecc313

[history-display-ui] Enable to navigate to each fragment from drawer layout

view details

push time in 19 days

push eventkenta7777/WeightControlApp

kenta7777

commit sha fd4aebdb83bd114731acdb88d788a36028fe2596

Fix some codes by detekt warning

view details

kenta7777

commit sha 5674dad7e7b446ff2617df95c5c7b950d87e2ec2

[history-display-ui] (WIP) Add DrawerLayout

view details

push time in 19 days

startedyhara/shiika

started time in 21 days

startedosdev-jp/osdev-jp.github.io

started time in 21 days

push eventkenta7777/WeightControlApp

kenta7777

commit sha a8753cc0918108f6904b3cf3295596860eb45d5e

[hostory-display-ui] upgrade core-ktx

view details

push time in 25 days

push eventkenta7777/WeightControlApp

kenta7777

commit sha 9734fb04cd5e23cf782bebe807352235acbd6f65

[history-display-ui] Add DrawerLayout for navigating each fragment

view details

push time in 25 days

push eventkenta7777/WeightControlApp

kenta7777

commit sha 55bc1c114cee0128f4e6b22cbe15a7167fc8623c

[history-display-ui] Enable to show history_fragment layout in HistoryFragment

view details

push time in a month

create barnchkenta7777/WeightControlApp

branch : history-display-ui

created branch time in a month

push eventkenta7777/WeightControlApp

kenta7777

commit sha 682f267a1f9a60e27ea142c27dc75f5773be907e

Fix layout

view details

push time in a month

delete branch kenta7777/WeightControlApp

delete branch : add-local-db

delete time in a month

push eventkenta7777/WeightControlApp

kenta7777

commit sha c5866450ff2675efb5ddd0426f5293f7f30aea74

[add-local-db] Update build.gradle to add Room

view details

kenta7777

commit sha 01aeba4362103f9b95769314ccf80dad51fc524b

[add-local-db] Make preparations for operating database by Room

view details

kenta7777

commit sha 4afc9a79db49e61d18dd3ba727783b9fd612c939

[add-local-db] Add functions which calles function defined in WeightDataDao

view details

kenta7777

commit sha 17604aae06fe13fb68b37212ce2ed8cdac2f5054

[add-local-db] Inserts weight data to local database

view details

kenta7777

commit sha 56eb0306cf473dba276422a091c3e5c64381a084

[add-local-db] Update the definition of WeightData

view details

kenta7777

commit sha 70229ca989e0703fc0d91c3ad907a8cffb692372

[add-local-db] Create function which finds a WeightData by id

view details

kenta7777

commit sha e184622953e5ef92ab8c4aa1b0632af9b42f4c08

[add-local-db] Define a funtion which uses findWeightDataById() declared in WeightDataDao

view details

kenta7777

commit sha 120339a51364a3232765e2eee9daa82c8ed2fdf6

[add-local-db] Create a Test of inserting WeightData into db

view details

kenta7777

commit sha d0d143cedbd26e73f8f8c87e6cff1c244e8c22eb

[add-local-db] add a test of failing findWeightDataById()

view details

kenta7777

commit sha 015be3539b2296186f133d730a1feeb380509a53

[add-local-db] Fix comment outs

view details

kenta7777

commit sha 0326e9565e8ee1aba4b2d6c3e1d048543beda7df

[add-local-db] add new line of end

view details

kenta7777

commit sha bb0bcff9881932d4a1fccfe8fcd8f1b49ff7c9c6

[add-local-db] Allow for destructive migration of DB

view details

Kenta

commit sha b8f085222bea0b7ec4825d50452acec8bc7e761f

Merge pull request #5 from kenta7777/add-local-db Add Local Database

view details

push time in a month

PR merged kenta7777/WeightControlApp

Add Local Database enhancement
  • [x] Implement a function which inserts user's weight data into the local database

  • [x] Test whether the function inserts user's weight data into the local database

+212 -0

1 comment

9 changed files

kenta7777

pr closed time in a month

push eventkenta7777/WeightControlApp

kenta7777

commit sha bb0bcff9881932d4a1fccfe8fcd8f1b49ff7c9c6

[add-local-db] Allow for destructive migration of DB

view details

push time in a month

push eventkenta7777/WeightControlApp

kenta7777

commit sha 0326e9565e8ee1aba4b2d6c3e1d048543beda7df

[add-local-db] add new line of end

view details

push time in a month

Pull request review commentkenta7777/WeightControlApp

Add Local DataBase

+package com.example.weightcontrolapp.ui.weightrecord++import android.content.Context+import androidx.room.Room+import androidx.test.core.app.ApplicationProvider+import androidx.test.ext.junit.runners.AndroidJUnit4+import com.example.weightcontrolapp.data.local.db.AppDatabase+import com.example.weightcontrolapp.data.local.db.dao.WeightDataDao+import com.example.weightcontrolapp.data.model.db.WeightData+import junit.framework.Assert.assertEquals+import kotlinx.coroutines.runBlocking+import org.junit.After+import org.junit.Before+import org.junit.Test+import org.junit.runner.RunWith+import java.io.IOException+import java.util.*++@RunWith(AndroidJUnit4::class)+class InsertWeightDataTest {+    private lateinit var db: AppDatabase+    private lateinit var dao: WeightDataDao++    @Before+    fun createDb() {+        val context = ApplicationProvider.getApplicationContext<Context>()+        db = Room.inMemoryDatabaseBuilder(+            context, AppDatabase::class.java+        ).build()+        dao = db.weightDataDao()+    }++    @After+    @Throws(IOException::class)+    fun closeDb() {+        db.close()+    }++    @Test+    @Throws(Exception::class)+    fun testInsertWeightData() = runBlocking {+        val dummyId = 0+        val dummyDate = Date()+        val dummyWeight = "0"+        val weightData = WeightData(dummyId, dummyDate, dummyWeight)++        // insert dummy

done

kenta7777

comment created time in a month

PullRequestReviewEvent

Pull request review commentkenta7777/WeightControlApp

Add Local DataBase

+package com.example.weightcontrolapp.ui.weightrecord++import android.content.Context+import androidx.room.Room+import androidx.test.core.app.ApplicationProvider+import androidx.test.ext.junit.runners.AndroidJUnit4+import com.example.weightcontrolapp.data.local.db.AppDatabase+import com.example.weightcontrolapp.data.local.db.dao.WeightDataDao+import com.example.weightcontrolapp.data.model.db.WeightData+import junit.framework.Assert.assertEquals+import kotlinx.coroutines.runBlocking+import org.junit.After+import org.junit.Before+import org.junit.Test+import org.junit.runner.RunWith+import java.io.IOException+import java.util.*++@RunWith(AndroidJUnit4::class)+class InsertWeightDataTest {+    private lateinit var db: AppDatabase+    private lateinit var dao: WeightDataDao++    @Before+    fun createDb() {+        val context = ApplicationProvider.getApplicationContext<Context>()+        db = Room.inMemoryDatabaseBuilder(+            context, AppDatabase::class.java+        ).build()+        dao = db.weightDataDao()+    }++    @After+    @Throws(IOException::class)+    fun closeDb() {+        db.close()+    }++    @Test+    @Throws(Exception::class)+    fun testInsertWeightData() = runBlocking {+        val dummyId = 0+        val dummyDate = Date()+        val dummyWeight = "0"+        val weightData = WeightData(dummyId, dummyDate, dummyWeight)

done

kenta7777

comment created time in a month

PullRequestReviewEvent

Pull request review commentkenta7777/WeightControlApp

Add Local DataBase

 class WeightRecordFragment : Fragment() {                 Snackbar.make(v, "Record your weight!!", Snackbar.LENGTH_LONG)                     .setAction("Action", null).show()             } else {+                // insert weight data to db

done

kenta7777

comment created time in a month

PullRequestReviewEvent

Pull request review commentkenta7777/WeightControlApp

Add Local DataBase

+package com.example.weightcontrolapp.data.local.db.dao++import androidx.room.Dao+import androidx.room.Insert+import androidx.room.OnConflictStrategy+import androidx.room.Query+import com.example.weightcontrolapp.data.model.db.WeightData++@Dao+interface WeightDataDao {+    // load all weight data in database

done

kenta7777

comment created time in a month

PullRequestReviewEvent

Pull request review commentkenta7777/WeightControlApp

Add Local DataBase

+package com.example.weightcontrolapp.data.local.db++import androidx.room.Database+import androidx.room.RoomDatabase+import androidx.room.TypeConverters+import com.example.weightcontrolapp.data.DateConverters+import com.example.weightcontrolapp.data.local.db.dao.WeightDataDao+import com.example.weightcontrolapp.data.model.db.WeightData++// With @Database, this class connects SQLite directly.+// Entity class: DB table+@Database(entities = [WeightData::class], version = 1)+@TypeConverters(DateConverters::class)+abstract class AppDatabase : RoomDatabase() {+    //TODO: implement abstract method of Dao interface defined in @Dao

done

kenta7777

comment created time in a month

PullRequestReviewEvent

Pull request review commentkenta7777/WeightControlApp

Add Local DataBase

+package com.example.weightcontrolapp.data.local.db++import androidx.room.Database+import androidx.room.RoomDatabase+import androidx.room.TypeConverters+import com.example.weightcontrolapp.data.DateConverters+import com.example.weightcontrolapp.data.local.db.dao.WeightDataDao+import com.example.weightcontrolapp.data.model.db.WeightData++// With @Database, this class connects SQLite directly.+// Entity class: DB table

done

kenta7777

comment created time in a month

PullRequestReviewEvent

Pull request review commentkenta7777/WeightControlApp

Add Local DataBase

+package com.example.weightcontrolapp.ui.weightrecord++import android.content.Context+import androidx.room.Room+import androidx.test.core.app.ApplicationProvider+import androidx.test.ext.junit.runners.AndroidJUnit4+import com.example.weightcontrolapp.data.local.db.AppDatabase+import com.example.weightcontrolapp.data.local.db.dao.WeightDataDao+import com.example.weightcontrolapp.data.model.db.WeightData+import junit.framework.Assert.assertEquals+import kotlinx.coroutines.runBlocking+import org.junit.After+import org.junit.Before+import org.junit.Test+import org.junit.runner.RunWith+import java.io.IOException+import java.util.*++@RunWith(AndroidJUnit4::class)+class InsertWeightDataTest {+    private lateinit var db: AppDatabase+    private lateinit var dao: WeightDataDao++    @Before+    fun createDb() {+        val context = ApplicationProvider.getApplicationContext<Context>()+        db = Room.inMemoryDatabaseBuilder(+            context, AppDatabase::class.java+        ).build()+        dao = db.weightDataDao()+    }++    @After+    @Throws(IOException::class)+    fun closeDb() {+        db.close()+    }++    @Test+    @Throws(Exception::class)+    fun testInsertWeightData() = runBlocking {+        val dummyId = 0+        val dummyDate = Date()+        val dummyWeight = "0"+        val weightData = WeightData(dummyId, dummyDate, dummyWeight)++        // insert dummy+        dao.insertWeightData(weightData)++        // findbyWeightId+        // id generated automatically was 1, so specifies parameter of findWeightDataById as 1+        val expectedWeightData = dao.findWeightDataById(1)++        assertEquals(expectedWeightData.weight, dummyWeight)+    }

done

kenta7777

comment created time in a month

PullRequestReviewEvent

Pull request review commentkenta7777/WeightControlApp

Add Local DataBase

 dependencies {     androidTestImplementation 'androidx.test.ext:junit:1.1.2'     androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' +    // Room+    def room_version = "2.2.5"++    implementation "androidx.room:room-runtime:$room_version"+    kapt "androidx.room:room-compiler:$room_version"++    // optional - Kotlin Extensions and Coroutines support for Room+    implementation "androidx.room:room-ktx:$room_version"++    // optional - Test helpers

done

kenta7777

comment created time in a month

PullRequestReviewEvent

push eventkenta7777/WeightControlApp

kenta7777

commit sha d0d143cedbd26e73f8f8c87e6cff1c244e8c22eb

[add-local-db] add a test of failing findWeightDataById()

view details

kenta7777

commit sha 015be3539b2296186f133d730a1feeb380509a53

[add-local-db] Fix comment outs

view details

push time in a month

Pull request review commentkenta7777/WeightControlApp

Add Local DataBase

+package com.example.weightcontrolapp.ui.weightrecord++import android.content.Context+import androidx.room.Room+import androidx.test.core.app.ApplicationProvider+import androidx.test.ext.junit.runners.AndroidJUnit4+import com.example.weightcontrolapp.data.local.db.AppDatabase+import com.example.weightcontrolapp.data.local.db.dao.WeightDataDao+import com.example.weightcontrolapp.data.model.db.WeightData+import junit.framework.Assert.assertEquals+import kotlinx.coroutines.runBlocking+import org.junit.After+import org.junit.Before+import org.junit.Test+import org.junit.runner.RunWith+import java.io.IOException+import java.util.*++@RunWith(AndroidJUnit4::class)+class InsertWeightDataTest {+    private lateinit var db: AppDatabase+    private lateinit var dao: WeightDataDao++    @Before+    fun createDb() {+        val context = ApplicationProvider.getApplicationContext<Context>()+        db = Room.inMemoryDatabaseBuilder(+            context, AppDatabase::class.java+        ).build()+        dao = db.weightDataDao()+    }++    @After+    @Throws(IOException::class)+    fun closeDb() {+        db.close()+    }++    @Test+    @Throws(Exception::class)+    fun testInsertWeightData() = runBlocking {+        val dummyId = 0+        val dummyDate = Date()+        val dummyWeight = "0"+        val weightData = WeightData(dummyId, dummyDate, dummyWeight)++        // insert dummy

Remove.

kenta7777

comment created time in a month

Pull request review commentkenta7777/WeightControlApp

Add Local DataBase

 class WeightRecordFragment : Fragment() {                 Snackbar.make(v, "Record your weight!!", Snackbar.LENGTH_LONG)                     .setAction("Action", null).show()             } else {+                // insert weight data to db

Remove.

kenta7777

comment created time in a month

Pull request review commentkenta7777/WeightControlApp

Add Local DataBase

+package com.example.weightcontrolapp.ui.weightrecord++import android.content.Context+import androidx.room.Room+import androidx.test.core.app.ApplicationProvider+import androidx.test.ext.junit.runners.AndroidJUnit4+import com.example.weightcontrolapp.data.local.db.AppDatabase+import com.example.weightcontrolapp.data.local.db.dao.WeightDataDao+import com.example.weightcontrolapp.data.model.db.WeightData+import junit.framework.Assert.assertEquals+import kotlinx.coroutines.runBlocking+import org.junit.After+import org.junit.Before+import org.junit.Test+import org.junit.runner.RunWith+import java.io.IOException+import java.util.*++@RunWith(AndroidJUnit4::class)+class InsertWeightDataTest {+    private lateinit var db: AppDatabase+    private lateinit var dao: WeightDataDao++    @Before+    fun createDb() {+        val context = ApplicationProvider.getApplicationContext<Context>()+        db = Room.inMemoryDatabaseBuilder(+            context, AppDatabase::class.java+        ).build()+        dao = db.weightDataDao()+    }++    @After+    @Throws(IOException::class)+    fun closeDb() {+        db.close()+    }++    @Test+    @Throws(Exception::class)+    fun testInsertWeightData() = runBlocking {+        val dummyId = 0+        val dummyDate = Date()+        val dummyWeight = "0"+        val weightData = WeightData(dummyId, dummyDate, dummyWeight)

s/weightData/dummyWeightData

kenta7777

comment created time in a month

Pull request review commentkenta7777/WeightControlApp

Add Local DataBase

 package com.example.weightcontrolapp.ui.weightrecord  import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel+import com.example.weightcontrolapp.MainActivity+import com.example.weightcontrolapp.data.model.db.WeightData+import kotlinx.coroutines.CoroutineScope+import kotlinx.coroutines.Dispatchers+import kotlinx.coroutines.launch+import kotlinx.coroutines.withContext+import timber.log.Timber  class WeightRecordViewModel : ViewModel() {     var userWeightText = MutableLiveData<String>()++    private val dao = MainActivity.db.weightDataDao()++    //TODO: use when implement history screen+    fun loadAllWeightDataList(): List<WeightData> {+        var weightDataList = listOf<WeightData>()

may change var to val if replace listOf with mutableListOf?

kenta7777

comment created time in a month

Pull request review commentkenta7777/WeightControlApp

Add Local DataBase

+package com.example.weightcontrolapp.data.local.db++import androidx.room.Database+import androidx.room.RoomDatabase+import androidx.room.TypeConverters+import com.example.weightcontrolapp.data.DateConverters+import com.example.weightcontrolapp.data.local.db.dao.WeightDataDao+import com.example.weightcontrolapp.data.model.db.WeightData++// With @Database, this class connects SQLite directly.+// Entity class: DB table

Remove these codes.

kenta7777

comment created time in a month

Pull request review commentkenta7777/WeightControlApp

Add Local DataBase

+package com.example.weightcontrolapp.data.local.db.dao++import androidx.room.Dao+import androidx.room.Insert+import androidx.room.OnConflictStrategy+import androidx.room.Query+import com.example.weightcontrolapp.data.model.db.WeightData++@Dao+interface WeightDataDao {+    // load all weight data in database

s/weight data/WeightData s/database/AppDatabase

kenta7777

comment created time in a month

Pull request review commentkenta7777/WeightControlApp

Add Local DataBase

+package com.example.weightcontrolapp.ui.weightrecord++import android.content.Context+import androidx.room.Room+import androidx.test.core.app.ApplicationProvider+import androidx.test.ext.junit.runners.AndroidJUnit4+import com.example.weightcontrolapp.data.local.db.AppDatabase+import com.example.weightcontrolapp.data.local.db.dao.WeightDataDao+import com.example.weightcontrolapp.data.model.db.WeightData+import junit.framework.Assert.assertEquals+import kotlinx.coroutines.runBlocking+import org.junit.After+import org.junit.Before+import org.junit.Test+import org.junit.runner.RunWith+import java.io.IOException+import java.util.*++@RunWith(AndroidJUnit4::class)+class InsertWeightDataTest {+    private lateinit var db: AppDatabase+    private lateinit var dao: WeightDataDao++    @Before+    fun createDb() {+        val context = ApplicationProvider.getApplicationContext<Context>()+        db = Room.inMemoryDatabaseBuilder(+            context, AppDatabase::class.java+        ).build()+        dao = db.weightDataDao()+    }++    @After+    @Throws(IOException::class)+    fun closeDb() {+        db.close()+    }++    @Test+    @Throws(Exception::class)+    fun testInsertWeightData() = runBlocking {+        val dummyId = 0+        val dummyDate = Date()+        val dummyWeight = "0"+        val weightData = WeightData(dummyId, dummyDate, dummyWeight)++        // insert dummy+        dao.insertWeightData(weightData)++        // findbyWeightId+        // id generated automatically was 1, so specifies parameter of findWeightDataById as 1+        val expectedWeightData = dao.findWeightDataById(1)++        assertEquals(expectedWeightData.weight, dummyWeight)+    }

Return value which fails the call of findWeightDataById() is null, so you should add tests in the case(perhaps, you should add the other tests).

kenta7777

comment created time in a month

Pull request review commentkenta7777/WeightControlApp

Add Local DataBase

 dependencies {     androidTestImplementation 'androidx.test.ext:junit:1.1.2'     androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' +    // Room+    def room_version = "2.2.5"++    implementation "androidx.room:room-runtime:$room_version"+    kapt "androidx.room:room-compiler:$room_version"++    // optional - Kotlin Extensions and Coroutines support for Room+    implementation "androidx.room:room-ktx:$room_version"++    // optional - Test helpers

Remove comment outs.

kenta7777

comment created time in a month

Pull request review commentkenta7777/WeightControlApp

Add Local DataBase

+package com.example.weightcontrolapp.data.local.db++import androidx.room.Database+import androidx.room.RoomDatabase+import androidx.room.TypeConverters+import com.example.weightcontrolapp.data.DateConverters+import com.example.weightcontrolapp.data.local.db.dao.WeightDataDao+import com.example.weightcontrolapp.data.model.db.WeightData++// With @Database, this class connects SQLite directly.+// Entity class: DB table+@Database(entities = [WeightData::class], version = 1)+@TypeConverters(DateConverters::class)+abstract class AppDatabase : RoomDatabase() {+    //TODO: implement abstract method of Dao interface defined in @Dao

Remove because finished implementing interface annotated @Dao

kenta7777

comment created time in a month

PullRequestReviewEvent
PullRequestReviewEvent

pull request commentkenta7777/WeightControlApp

Add Local DataBase

Should add a test which fails insertWeightData()

kenta7777

comment created time in a month

PR opened kenta7777/WeightControlApp

Add Local DataBase
  • [ ] Implement a function which inserts user's weight data into the local database

  • [ ] Test whether the function inserts user's weight data into the local database

+205 -0

0 comment

9 changed files

pr created time in a month

push eventkenta7777/WeightControlApp

kenta7777

commit sha 70229ca989e0703fc0d91c3ad907a8cffb692372

[add-local-db] Create function which finds a WeightData by id

view details

kenta7777

commit sha e184622953e5ef92ab8c4aa1b0632af9b42f4c08

[add-local-db] Define a funtion which uses findWeightDataById() declared in WeightDataDao

view details

kenta7777

commit sha 120339a51364a3232765e2eee9daa82c8ed2fdf6

[add-local-db] Create a Test of inserting WeightData into db

view details

push time in a month

push eventkenta7777/WeightControlApp

kenta7777

commit sha 56eb0306cf473dba276422a091c3e5c64381a084

[add-local-db] Update the definition of WeightData

view details

push time in a month

push eventkenta7777/WeightControlApp

kenta7777

commit sha 17604aae06fe13fb68b37212ce2ed8cdac2f5054

[add-local-db] Inserts weight data to local database

view details

push time in a month

push eventkenta7777/WeightControlApp

kenta7777

commit sha 4afc9a79db49e61d18dd3ba727783b9fd612c939

[add-local-db] Add functions which calles function defined in WeightDataDao

view details

push time in a month

push eventkenta7777/WeightControlApp

kenta7777

commit sha 01aeba4362103f9b95769314ccf80dad51fc524b

[add-local-db] Make preparations for operating database by Room

view details

push time in a month

create barnchkenta7777/WeightControlApp

branch : add-local-db

created branch time in a month

push eventkenta7777/WeightControlApp

kenta7777

commit sha bcb196e8794812675c0c788a6a36d443d097b20b

Fix some files by detekt outputs

view details

push time in a month

push eventkenta7777/WeightControlApp

kenta7777

commit sha 85b6ed1a4b0226eb7e45845c2debab549f09b5b5

Remove files related to detekt log

view details

push time in a month

push eventkenta7777/WeightControlApp

kenta7777

commit sha 7187b2c137986d336c00aa80e6083b70952cf80b

update .gitignore

view details

push time in a month

more