AndroidIDEOfficial / AndroidIDE

AndroidIDE is an IDE for Android to develop full featured Android apps.
https://m.androidide.com
GNU General Public License v3.0
2.08k stars 244 forks source link

[Feature]: Display Recently Opened Projects for Easier Project Selection #1284

Open Ruan625Br opened 9 months ago

Ruan625Br commented 9 months ago

Feature description

Initially, I was considering implementing a feature to display a list of all projects to facilitate project selection. However, upon further consideration, I decided that it would be more beneficial to prioritize the display of recently opened projects instead of a list containing all projects.

Initially Planned Approach:

  1. Show a list of all projects.
  2. Ease project selection by providing a comprehensive list.

Revised Approach:

  1. Display a list of recently opened projects.
  2. Prioritize projects that have been accessed recently.
  3. Streamline project selection for users by presenting relevant information.

I have already implemented the feature to display a list of all projects, but I am now transitioning from the all-projects list to the list of recently opened projects. This change should enhance the overall user experience and usability of the application. Please review and consider this feature request for implementation.

Screenshot of the list with all projects

MainFragment ProjectListFragment
Img 1 Img 2

Screenshot of recent projects list

In progress, I'll come back here to update...

What version of AndroidIDE you're using?

v2.5.2 (debug builds)

Duplicate issues

Code of Conduct

itsaky commented 9 months ago

How are you planning to store the information about recently opened projects? Would you be using shared preferences, JSON files, or anything else?

MrIkso commented 9 months ago

We recommend using a room database

itsaky commented 9 months ago

We recommend using a room database

I agree. A proper API is needed for #1227 as well.

Ruan625Br commented 9 months ago

The data pertaining to recently opened projects is stored in a JSON file, 'editor/projectInfo.json.' This JSON file serves as a repository for saving and retrieving project-related information, mirroring the approach taken with the 'OpenedFilesCache.' While considering storage options, I briefly contemplated using a database system like SQLite. However, I opted for the JSON file due to its simplicity and lower implementation risk.

itsaky commented 9 months ago

mirroring the approach taken with the 'OpenedFilesCache.

It needs to be implemented with Room DB as well.

While considering storage options, I briefly contemplated using a database system like SQLite. However, I opted for the JSON file due to its simplicity and lower implementation risk.

Prefer using Room DB so that we won't have to rewrite everything afterwards.

Ruan625Br commented 9 months ago

Is Room db already implemented?

MrIkso commented 9 months ago

We recommend using a room database

I agree. A proper API is needed for #1227 as well.

Hmm, for saving project state, i think best used currently json state in opened projects, not a in app.

Ruan625Br commented 9 months ago

Implemented list of recently opened projects

Recently opened projects are stored in the Room database, containing essential project information without unnecessary data.

I'm sorry if I write anything wrong here, I'm Brazilian and don't speak English, I'm using Google Translate

Screenshot

MainFragment ProjectListFragment - Empty project list ProjectListFragment - List of recently opened projects
img1 img2 img3

Database structure

Room db
image

ProjectInfo

@Entity(tableName = "project_info")
data class ProjectInfo(
  @PrimaryKey(autoGenerate = true)
  val id: Int = 0,
  val name: String,
  @TypeConverters(FileTypeConverter::class)
  val file: File,
  @TypeConverters(ProjectInfoCacheTypeConverter::class)
  val cache: ProjectInfoCache
)

@MrIkso @itsaky

MrIkso commented 9 months ago

You must implement clear this list or add option delete selcted project from this list

Ruan625Br commented 9 months ago

Ok

itsaky commented 9 months ago

@Ruan625Br Please open a draft PR. We can review the changes beforehand as you update the repository so you won't have to make a lot of changes later.

Ruan625Br commented 9 months ago

@itsaky I just got back from school, tomorrow I will implement an option to remove project from the list, right after opening a PR draft.

Ruan625Br commented 9 months ago

@itsaky I've already opened the PR draft.