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.database; | |
import com.mwb.digitalstorage.model.Component; | |
import com.mwb.digitalstorage.model.ComponentCat; | |
import com.mwb.digitalstorage.model.Rack; | |
import com.mwb.digitalstorage.model.Storage; | |
import androidx.lifecycle.LiveData; | |
import androidx.room.Dao; | |
import androidx.room.Insert; |
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 static class insertAsyncTask extends AsyncTask<Storage, Void, Long> | |
{ | |
DAO _dao; | |
protected insertAsyncTask(DAO dao) | |
{ | |
_dao = dao; | |
} | |
@Override |
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
protected void onPostExecute(Long storageIDResult) | |
{ | |
if (amountOfRacks != 0) | |
{ | |
for (int i=1; i<=amountOfRacks; i++) | |
{ | |
rackRep.insertRack(new Rack("Kast_" + i, "", storageIDResult)); | |
} | |
} | |
} |
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.database; | |
..// | |
public class StorageRepository | |
{ | |
private DAO dao; | |
private LiveData<List<Storage>> storageUnits; | |
public StorageRepository(Application application) |
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
// This compiles | |
@Override | |
public void goToItem(Item item) | |
{ | |
Storage storage = (Storage)item; | |
Intent intent = new Intent(MainActivity.this, StorageActivity.class); | |
intent.putExtra("storageID", storage.storageID); | |
intent.putExtra("storage_name", storage.getStorageName()); | |
intent.putExtra("storage_loc", storage.getStorageLoc()); | |
switchActivity(intent); |
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"> | |
<data> | |
<variable | |
name="commandHandlers" | |
type="com.mwb.digitalstorage.command_handlers.ItemHandler"/> | |
<variable | |
name="component" | |
type="com.mwb.digitalstorage.model.Component"/> |
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
/** | |
* Add a quick meeting and refresh app in background thread. | |
*/ | |
public class AddEventInBackground { | |
Context mContext; | |
public AddEventInBackground(Context mContext) | |
// it goes untill this bracket { | |
this.mContext = mContext; | |
} |
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
public int getCategoryComponentAmount(long catID) | |
{ | |
rackVM.getComponentRepository().getComponentCatAmount(catID).observe(this, amount -> | |
{ | |
return rackVM.getComponentRepository().getComponentCatAmount(catID); | |
}); | |
} |
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
// ComponentCategoryListAdapter.class | |
// | |
// here is where the componentCat gets its values set | |
// | |
public void onBindViewHolder(@NonNull ComponentCategoryListAdapter.ComponentCategoryViewHolder holder, int position) | |
{ | |
ComponentCat componentCat = componentCats.get(position); | |
componentCat.setAmountOfComponents(rackActivityCmdHandler.getCategoryComponentAmount(componentCat.componentCatID)); | |
holder.bind(componentCat); |
This file has been truncated, but you can view the full file.
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
ed | |
16:15:39.143 [DEBUG] [org.gradle.launcher.daemon.server.SynchronizedDispatchConnection] thread 315: dispatching class org.gradle.launcher.daemon.protocol.BuildEvent | |
16:15:39.143 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Build operation 'Apply com.android.build.gradle.internal.dependency.IdentityTransform -> com.android.build.gradle.internal.dependency.ExtractAarTransform -> com.android.build.gradle.internal.dependency.AarTransform to appcompat.aar (androidx.appcompat:appcompat:1.0.0)' completed | |
16:15:39.143 [DEBUG] [org.gradle.launcher.daemon.server.SynchronizedDispatchConnection] thread 312: dispatching class org.gradle.launcher.daemon.protocol.BuildEvent | |
16:15:39.143 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Build operation 'Apply com.android.build.gradle.internal.dependency.IdentityTransform -> com.android.build.gradle.internal.dependency.ExtractAarTransform -> com.android.build.gradle.internal.dependency.AarTransform to appcompat.aar (androidx.appco |