[templates] fix broken/wrong item template contents #7366
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After working on #7349, I found some really odd behavior if you name an Android layout,
my_cool_layout.xml
.VS appears to generate:
This is completely broken! It appears that anywhere the word
Layout
was replaced withmy_cool_layout
. I also get the same behavior withdotnet new android-layout -n my_cool_layout
.To solve this issue, I made the default name
Layout1
, so that<LinearLayout/>
andandroid:layout_width
, are not replaced.Now I get a
my_cool_layout.xml
with the contents:Secondly, the
android-activity
template if you run:It will generate:
Let's replace the label with the name passed in, and remove
MainLauncher=true
, so we instead get:I think this will prevent confusion with multiple app launchers, etc.