99import android .os .Bundle ;
1010import android .provider .Settings ;
1111import android .view .View ;
12+ import android .widget .LinearLayout ;
1213
1314import androidx .appcompat .app .AppCompatActivity ;
15+ import androidx .recyclerview .widget .LinearLayoutManager ;
1416import androidx .recyclerview .widget .RecyclerView ;
1517
1618import com .google .android .material .appbar .MaterialToolbar ;
1719import com .mcal .disassembler .R ;
20+ import com .mcal .disassembler .adapters .ListAdapter ;
1821import com .mcal .disassembler .data .Database ;
1922import com .mcal .disassembler .data .RecentsManager ;
2023import com .mcal .disassembler .interfaces .MainView ;
@@ -36,7 +39,6 @@ public class MainActivity extends AppCompatActivity implements MainView {
3639
3740 ProgressDialog dialog ;
3841 private MaterialToolbar toolbar ;
39- //private LinearLayout welcomeLayout;
4042 private RecyclerView recentOpened ;
4143 private ArrayList <String > paths = new ArrayList <>();
4244 private String path ;
@@ -55,7 +57,14 @@ public void onCreate(Bundle savedInstanceState) {
5557 new Database (this );
5658 //welcomeLayout = findViewById(R.id.welcome_layout);
5759 recentOpened = findViewById (R .id .items );
58-
60+ recentOpened .setLayoutManager (new LinearLayoutManager (this ));
61+ Cursor cursor = RecentsManager .getRecents ();
62+ if (cursor .getCount () > 0 ) {
63+ while (cursor .moveToNext ()) {
64+ paths .add (cursor .getString (0 ));
65+ }
66+ }
67+ recentOpened .setAdapter (new ListAdapter (paths , this ));
5968 //setupList();
6069 }
6170
0 commit comments