mirror of
https://github.com/LNH-team/pico-launcher.git
synced 2026-06-02 09:06:54 +02:00
Initial commit
This commit is contained in:
41
arm9/source/romBrowser/Theme/Material/CarouselRecyclerView.h
Normal file
41
arm9/source/romBrowser/Theme/Material/CarouselRecyclerView.h
Normal file
@@ -0,0 +1,41 @@
|
||||
#pragma once
|
||||
#include <array>
|
||||
#include "romBrowser/views/CoverFlowRecyclerViewBase.h"
|
||||
#include "animation/Animator.h"
|
||||
|
||||
class MaterialColorScheme;
|
||||
|
||||
class CarouselRecyclerView : public CoverFlowRecyclerViewBase
|
||||
{
|
||||
public:
|
||||
explicit CarouselRecyclerView(const MaterialColorScheme* materialColorScheme)
|
||||
: _materialColorScheme(materialColorScheme) { }
|
||||
|
||||
static void UploadGraphics(const VramContext& vramContext);
|
||||
|
||||
void Update() override;
|
||||
void Draw(GraphicsContext &graphicsContext) override;
|
||||
|
||||
private:
|
||||
struct ViewPoolEntryEx
|
||||
{
|
||||
Animator<fix32<12>> xPositionAnimator;
|
||||
Animator<fix32<12>> widthAnimator;
|
||||
};
|
||||
|
||||
std::array<ViewPoolEntryEx, 10> _viewPoolEx;
|
||||
const MaterialColorScheme* _materialColorScheme;
|
||||
|
||||
static u32 sMaskTextureVramOffset;
|
||||
|
||||
void RenderCoverMask(GraphicsContext& graphicsContext, fix32<12> left, fix32<12> right) const;
|
||||
void RenderRoundedCorners(GraphicsContext& graphicsContext, fix32<12> x, fix32<12> width) const;
|
||||
|
||||
void UpdateItemPosition(int viewPoolIndex, bool initial) override;
|
||||
|
||||
void SwapViewPoolEntry(int indexA, int indexB) override
|
||||
{
|
||||
CoverFlowRecyclerViewBase::SwapViewPoolEntry(indexA, indexB);
|
||||
std::swap(_viewPoolEx[indexA], _viewPoolEx[indexB]);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user