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
List<UIComponent> UIComponentList = new ArrayList<>(); | |
executor.execute( () -> | |
{ | |
for (Component component : components) | |
{ | |
UIComponent uiComponent = new UIComponent(component.componentID, component.getName(), component.getCode(), component.getImgPath()); | |
uiComponent.setCategoryName(getDao().getComponentCategory(component.componentCategoryID).getName()); | |
uiComponent.setAmount(getDao().getAmountOfComponents(component.rackID)); | |
UIComponentList.add(uiComponent); |
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
private UICompany uiCompany; | |
public void setViewModelElements() | |
{ | |
executor.execute(() -> | |
{ | |
uiCompany = companyRepository.getUiCompany(); | |
}); | |
} |
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
// manually sets the storage to storageUI | |
private List<UIStorage> createStorageUIList(List<Storage> storageUnits, Executor executor) | |
{ | |
List<UIStorage> UIStorageList = new ArrayList<>(); | |
for (Storage storage : storageUnits) | |
{ | |
executor.execute(() -> | |
{ | |
UIStorageList.add(createUIStorage(storage)); |
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
<ScrollView | |
android:layout_width="match_parent" | |
android:layout_height="0dp" | |
android:fillViewport="true" | |
app:layout_constraintBottom_toBottomOf="parent" | |
app:layout_constraintTop_toBottomOf="@id/company_img"> | |
<androidx.constraintlayout.widget.ConstraintLayout | |
android:layout_width="match_parent" | |
android:layout_height="0dp" |
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
<?xml version="1.0" encoding="utf-8"?> | |
<layout 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:background="@color/background" | |
tools:context=".RegistrationActivity"> | |
<data> | |
<import type="android.view.View" /> |
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
// adds the component | |
// checks if category is new | |
public void addComponent() | |
{ | |
if (newCategoryObsv.get()) | |
{ | |
executor.execute(() -> | |
{ | |
componentRepository.insertComponent(rackID, processNewCategoryInput(), uiComponent.nameObsv.get(), uiComponent.codeObsv.get(), | |
uiComponent.getImgPath(), 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
SELECT id, rack_id, component_category_id, name, code, img_path, COUNT(id) as count | |
FROM component | |
WHERE rack_id = 1 | |
GROUP BY code |
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
<?xml version="1.0" encoding="utf-8"?> | |
<layout 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"> | |
<androidx.constraintlayout.widget.ConstraintLayout | |
android:layout_width="match_parent" | |
android:layout_height="150dp" | |
android:background="#65030303"> |
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
// get all components belonging to a rack | |
@Query("SELECT c.id, cc.name as category_name, c.rack_id, c.component_category_id, c.name, c.img_path, c.code, " + | |
" (SELECT COUNT(c.name) " + | |
" FROM rack r " + | |
" WHERE c.rack_id = : rackID ) as count " + | |
"FROM component c " + | |
"INNER JOIN component_category cc ON cc.id = c.component_category_id " + | |
"WHERE c.rack_id = :rackID and cc.id = c.component_category_id " + | |
"ORDER BY c.name ASC") | |
LiveData<List<Component>> getRackComponents(long rackID); |
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
package com.mwb.digitalstorage; | |
import android.Manifest; | |
import android.app.Activity; | |
import android.content.Intent; | |
import android.content.pm.PackageManager; | |
import android.os.Bundle; | |
import android.os.Environment; | |
import com.mwb.digitalstorage.command_handlers.RegistrationCmdHandler; |